diff options
author | John Ericson <git@JohnEricson.me> | 2019-07-10 12:16:52 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-14 01:21:48 -0400 |
commit | bd9fc1b2adea718be089b8370d2e82ea55af6539 (patch) | |
tree | 8ed80e58d2b634c58a600dcb085b74885cb3923d /.gitlab | |
parent | e7ed53c9c347bbf6650f268b516da6e6c156a91a (diff) | |
download | haskell-bd9fc1b2adea718be089b8370d2e82ea55af6539.tar.gz |
Make CPP linter skip certain files
- docs which document the lint and need to contain the unutterable
- vendored code which is outside our purview
Diffstat (limited to '.gitlab')
-rwxr-xr-x | .gitlab/linters/check-cpp.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/.gitlab/linters/check-cpp.py b/.gitlab/linters/check-cpp.py index c89451399e..c51c127379 100755 --- a/.gitlab/linters/check-cpp.py +++ b/.gitlab/linters/check-cpp.py @@ -3,6 +3,7 @@ # A linter to warn for ASSERT macros which are separated from their argument # list by a space, which Clang's CPP barfs on +from pathlib import Path from linter import run_linters, RegexpLinter linters = [ @@ -20,5 +21,11 @@ linters = [ message='`#if !defined(x)` is preferred to `#ifndef x`'), ] +for l in linters: + # Need do document rules! + l.add_path_filter(lambda path: path != Path('docs', 'coding-style.html')) + # Don't lint vendored code + l.add_path_filter(lambda path: not path.name == 'config.guess') + if __name__ == '__main__': run_linters(linters) |