Commit 11b34154 authored by Fletcher Woodruff's avatar Fletcher Woodruff Committed by LUCI CQ

cpplint: move a build/include check to subcategory

There is a cpplint include check that ensures that all includes have a
directory name preceding them. However, if all source lives in the root
of a repository, there is no point in having a directory.

Because this check lives under 'build/include', it's impossible to
filter without filtering other useful checks.

Move it to 'build/include_directory' so it can be more easily filtered.

BUG=chromium:1073191
TEST=cros lint on a file with 'filter=-build/include_directory' in
     CPPLINT.cfg

Change-Id: Ie15fb2398a6d0297ef96219e67076ea262abf853
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2159690Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Fletcher Woodruff <fletcherw@chromium.org>
parent 8533236d
......@@ -188,6 +188,7 @@ _ERROR_CATEGORIES = [
'build/header_guard',
'build/include',
'build/include_alpha',
'build/include_directory',
'build/include_order',
'build/include_what_you_use',
'build/namespaces',
......@@ -424,8 +425,8 @@ _TYPES = re.compile(
r')$')
# These headers are excluded from [build/include] and [build/include_order]
# checks:
# These headers are excluded from [build/include], [build/include_directory],
# and [build/include_order] checks:
# - Anything not following google file name conventions (containing an
# uppercase character, such as Python.h or nsStringAPI.h, for example).
# - Lua headers.
......@@ -4412,7 +4413,7 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
# naming convention but not the include convention.
match = Match(r'#include\s*"([^/]+\.h)"', line)
if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)):
error(filename, linenum, 'build/include', 4,
error(filename, linenum, 'build/include_directory', 4,
'Include the directory when naming .h files')
# we shouldn't include a file more than once. actually, there are a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment