This only changs the clang-format file and adds documentation
referring to the new process for formatting code. A future commit
will perform a reformatting according to these new formatting
settings.
Original-commit: flang-compiler/f18@
02531d788e7550a2455633f87d22e3f30de7a3a7
Reviewed-on: https://github.com/flang-compiler/f18/pull/945
BasedOnStyle: LLVM
AlignAfterOpenBracket: DontAlign
AlignEscapedNewlines: DontAlign
-AllowShortCaseLabelsOnASingleLine: true
-AllowShortIfStatementsOnASingleLine: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: false
AlignTrailingComments: false
-ConstructorInitializerIndentWidth: 2
-SpaceAfterTemplateKeyword: false
-SpacesBeforeTrailingComments: 2
-FixNamespaceComments: false
IncludeCategories:
- Regex: '^<'
Priority: 4
features in comments.
### Layout
-Always run `clang-format` before committing code. Other developers should
-be able to run `git pull`, then `clang-format`, and see only their own
-changes. Use `clang-format` from llvm 7.
+Always run `clang-format` on your changes before committing code. LLVM
+has a `git-clang-format` script to facilitate running clang-format only
+on the lines that have changed.
Here's what you can expect to see `clang-format` do:
1. Indent with two spaces.
## Follow the style guide
The following items are taken from the [C++ style guide](C++style.md). But
even though I've read the style guide, they regularly trip me up.
-* Run clang-format version 7 on all .cpp and .h files.
+* Run clang-format using the git-clang-format script from LLVM HEAD.
* Make sure that all source lines have 80 or fewer characters. Note that
clang-format will do this for most code. But you may need to break up long
strings.