Visitar URL original
fix: match exclude_files against relative paths by yangfan-yf-yf · Pull Request #463 · cpplint/cpplint · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: cover anchored exclude pattern behavior
  • Loading branch information
yangfan-yf-yf committed Aug 9, 2026
commit db3dfc930f030a8e387cf86b71a7643c5e38cedf
3 changes: 2 additions & 1 deletion cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@
"exclude_files" allows to specify a regular expression to be matched against
the file path relative to the CPPLINT.cfg directory. Paths use "/" as the
separator on all platforms. If the expression matches, the file is skipped
and not run through the linter.
and not run through the linter. To exclude a directory subtree, use a prefix
pattern such as "^bar/" rather than an anchored directory pattern like "^bar$".

"linelength" allows to specify the allowed line length for the project.

Expand Down
1 change: 1 addition & 0 deletions cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7298,6 +7298,7 @@ def _write_file(path, content=""):
("baz.cc", "^baz[.]cc$", False),
("bar/baz.cc", "^bar/baz[.]cc$", False),
("bar/qux.cc", "^bar/baz[.]cc$", True),
("bar/baz.cc", "^bar$", True),
("bar/baz.cc", "^bar/", False),
],
)
Expand Down