Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clang format & skip build if no source file modified (#5433)
* [BUILD] Add clang format + build skipping * Add clang-format tool to check codestyle. Warning: it check the whole modified file, not the diff part, it's why it's lazy. Please also look if rules are perfect, i take the Linux codestyle from LLVM site Fix issue #5415 * Skip building project if no file is modified * Fix a wrong brace to trigger LINT * Make lint step outside of unix build scope * Add AccessModifierOffset: -8 * Typo fix & needs compile fix * Fix header priorities
- Loading branch information
Showing
6 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 8 | ||
UseTab: Always | ||
BreakBeforeBraces: Linux | ||
AllowShortIfStatementsOnASingleLine: false | ||
IndentCaseLabels: false | ||
AccessModifierOffset: -8 | ||
IncludeCategories: | ||
- Regex: '^".*' | ||
Priority: 2 | ||
- Regex: '^<.*' | ||
Priority: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/bash -e | ||
|
||
# Relative to git-repository root: | ||
TRIGGER_COMPILE_PATHS="src/|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" | ||
TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" | ||
|
||
needs_compile() { | ||
git diff --name-only $TRAVIS_COMMIT_RANGE | egrep -q "^($TRIGGER_COMPILE_PATHS)" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters