[flang] Remove non-alignment based divergences from LLVM formatting.
authorDavid Truby <david.truby@arm.com>
Wed, 18 Mar 2020 16:02:53 +0000 (16:02 +0000)
committerDavid Truby <david.truby@arm.com>
Mon, 23 Mar 2020 17:52:22 +0000 (17:52 +0000)
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

flang/.clang-format
flang/documentation/C++style.md
flang/documentation/PullRequestChecklist.md

index 21fb1ae..c1dfe06 100644 (file)
@@ -3,16 +3,10 @@
 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
index f8e5896..ca53246 100644 (file)
@@ -88,9 +88,9 @@ well as you do and avoid distracting her by calling out usage of new
 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.
index 1097bd1..9a43fa9 100644 (file)
@@ -31,7 +31,7 @@ can also be used when reviewing pull requests.
 ## 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.