From bd9fc1b2adea718be089b8370d2e82ea55af6539 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 10 Jul 2019 12:16:52 -0400 Subject: Make CPP linter skip certain files - docs which document the lint and need to contain the unutterable - vendored code which is outside our purview --- .gitlab/linters/check-cpp.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.1