Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude files or directories in cpplint.py #238

Closed
wants to merge 18 commits into from
Closed
Changes from 2 commits
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
7 changes: 6 additions & 1 deletion ament_cpplint/ament_cpplint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def main(argv=sys.argv[1:]):
parser.add_argument(
'--root', type=str,
help='The --root option for cpplint')
parser.add_argument(
'--exclude', default=[''],
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
nargs='*',
help='Exclude directories or C/C++ files to be checked.')
parser.add_argument(
'paths',
nargs='*',
Expand Down Expand Up @@ -144,7 +148,8 @@ def main(argv=sys.argv[1:]):
else:
print("Not using '--root'")
print('')
arguments += files
arguments += [file for file in files
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
if any(excl not in file or not excl for excl in args.exclude)]
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
filenames = ParseArguments(arguments)

for filename in filenames:
Expand Down