Create more targeted CPPLINT.cfg files.

This CL moves the filters out of the PRESUBMIT.py file and into specific
folder CPPLINT.cfg files. This allows having all the lints enabled in
the Tint code and specifically disabling in Dawn code as needed.

Bug: dawn:1339
Change-Id: Ieb0178b0aac0ea67c52cc5547984ea5696eef5a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86208
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2022-04-11 13:05:40 +00:00 committed by Dawn LUCI CQ
parent cee1b54058
commit fcf56791c1
7 changed files with 33 additions and 9 deletions

View File

@ -71,14 +71,7 @@ NONINCLUSIVE_REGEX_LIST = []
for reg in NONINCLUSIVE_REGEXES:
NONINCLUSIVE_REGEX_LIST.append(re.compile(reg))
LINT_FILTERS = [
"-build/header_guard", "-build/include", "-build/include_directory",
"-build/include_order", "-build/include_what_you_use", "-build/namespaces",
"-legal/copyright", "-readability/braces", "-readability/casting",
"-readability/inheritance", "-readability/namespace", "-runtime/explicit",
"-runtime/indentation_namespace", "-runtime/int", "-runtime/printf",
"-whitespace/empty_if_body"
]
LINT_FILTERS = []
def _CheckNonInclusiveLanguage(input_api, output_api, source_file_filter=None):
@ -97,7 +90,7 @@ def _CheckNonInclusiveLanguage(input_api, output_api, source_file_filter=None):
if len(matches):
return [
output_api.PresubmitPromptWarning('Non-inclusive language found:',
output_api.PresubmitPromptWarning("Non-inclusive language found:",
items=matches)
]

1
generator/CPPLINT.cfg Normal file
View File

@ -0,0 +1 @@
exclude_files=.*

5
include/dawn/CPPLINT.cfg Normal file
View File

@ -0,0 +1,5 @@
filter=-build/header_guard
filter=-build/include_order
filter=-readability/inheritance
filter=-runtime/explicit
filter=-runtime/indentation_namespace

View File

@ -0,0 +1,2 @@
filter=-build/header_guard
filter=-legal/copyright

5
samples/dawn/CPPLINT.cfg Normal file
View File

@ -0,0 +1,5 @@
filter=-build/header_guard
filter=-build/include
filter=-build/include_order
filter=-build/include_what_you_use
filter=-readability/casting

16
src/dawn/CPPLINT.cfg Normal file
View File

@ -0,0 +1,16 @@
filter=-build/header_guard
filter=-build/include
filter=-build/include_directory
filter=-build/include_order
filter=-build/include_what_you_use
filter=-build/namespaces
filter=-legal/copyright
filter=-readability/braces
filter=-readability/casting
filter=-readability/inheritance
filter=-readability/namespace
filter=-runtime/explicit
filter=-runtime/indentation_namespace
filter=-runtime/int
filter=-runtime/printf
filter=-whitespace/empty_if_body

2
src/include/CPPLINT.cfg Normal file
View File

@ -0,0 +1,2 @@
filter=-build/header_guard
filter=-legal/copyright