Skip to content

Commit c03e326

Browse files
author
Thomas Kiley
authored
Update version of clang format in CODING_STANDARDs
Was saying 3.8, but CBMC moved to version 7 in #3245
1 parent 937d557 commit c03e326

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

CODING_STANDARD.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,13 @@ To avoid waiting until you've made a PR to find formatting issues, you can
315315
install clang-format locally and run it against your code as you are working.
316316

317317
Different versions of clang-format have slightly different behaviors. CBMC uses
318-
clang-format-3.8 as it is available the repositories for Ubuntu 16.04 and
318+
clang-format-7.0 as it is available the repositories for Ubuntu 18.04 and
319319
Homebrew.
320320
To install on a Unix-like system, try installing using the system package
321321
manager:
322322
```
323-
apt-get install clang-format-3.8 # Run this on Ubuntu, Debian etc.
324-
brew install clang-format@3.8 # Run this on a Mac with Homebrew installed
323+
apt-get install clang-format-8 # Run this on Ubuntu, Debian etc.
324+
brew install clang-format@8 # Run this on a Mac with Homebrew installed
325325
```
326326

327327
If your platform doesn't have a package for clang-format, you can download a
@@ -333,18 +333,21 @@ the [LLVM Snapshot Builds page](http://llvm.org/builds/).
333333

334334
### FORMATTING A RANGE OF COMMITS
335335

336-
Clang-format is distributed with a driver script called git-clang-format-3.8.
336+
Clang-format is distributed with a driver script called git-clang-format-7.
337337
This script can be used to format git diffs (rather than entire files).
338338

339339
After committing some code, it is recommended to run:
340340
```
341-
git-clang-format-3.8 upstream/develop
341+
git-clang-format-7 upstream/develop
342342
```
343343
*Important:* If your branch is based on a branch other than `upstream/develop`,
344344
use the name or checksum of that branch instead. It is strongly recommended to
345345
rebase your work onto the tip of the branch it's based on before running
346346
`git-clang-format` in this way.
347347

348+
Note: git-clang-format uses the git config variable `clangformat.binary` so if you
349+
have multiple versions of clang-format installed, you might need to update this.
350+
348351
### RETROACTIVELY FORMATTING INDIVIDUAL COMMITS
349352

350353
If your works spans several commits and you'd like to keep the formatting
@@ -355,7 +358,7 @@ The following command will stop at each commit in the range and run
355358
clang-format on the diff at that point. This rewrites git history, so it's
356359
*unsafe*, and you should back up your branch before running this command:
357360
```
358-
git filter-branch --tree-filter 'git-clang-format-3.8 upstream/develop' \
361+
git filter-branch --tree-filter 'git-clang-format-7 upstream/develop' \
359362
-- upstream/develop..HEAD
360363
```
361364
*Important*: `upstream/develop` should be changed in *both* places in the

0 commit comments

Comments
 (0)