Skip to content

Commit dfdd25f

Browse files
authored
Merge pull request #7304 from tautschnig/bugfixes/4327-cpplint-empty-modules
cpplint custom check: support empty module_dependencies.txt
2 parents 8951e2d + dfd2aa6 commit dfdd25f

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Author: Michael Tautschnig
2+
3+
#include <util/other.h>
4+
5+
int main(int argc, char **argv)
6+
{
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.cpp
3+
4+
^regression/cpp-linter/includes/main.cpp:3: Module `` must not use `util/other.h` \[build/include\] \[4\]
5+
^# Total errors found: 1$
6+
^EXIT=1$
7+
^SIGNAL=0$

scripts/cpplint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5633,7 +5633,7 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error, modul
56335633
if has_src >= 0:
56345634
module_name = module_name[has_src+4:]
56355635
deps_name = os.path.dirname(include)
5636-
if deps_name and module_deps:
5636+
if deps_name and module_deps is not None:
56375637
may_use = any(deps_name.startswith(module) for module in module_deps)
56385638
if not may_use:
56395639
error(filename, linenum, 'build/include', 4,

0 commit comments

Comments
 (0)