Skip to content

Commit

Permalink
Add option to exit cleanly even if problems are found
Browse files Browse the repository at this point in the history
Some testing frameworks interpret tools exiting with a non-zero code as a
failure of the tool rather than the tests it performs, adding this option
allows panlint to be used with these tools. (e.g. arcanist).
  • Loading branch information
jrha committed Jul 13, 2017
1 parent b9334c9 commit 69a982e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panc/src/main/scripts/panlint/panlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ def main():
parser.add_argument('--vi', action='store_true', help='Output line numbers in a vi option style')
parser.add_argument('--table', action='store_true', help='Display a table of per-file problem stats')
parser.add_argument('--allow_mvn_templates', action='store_true', help='Allow use of maven templates')
parser.add_argument('--ignore_problems_on_exit', action='store_true', help='Exit cleanly even if problems are found')
group_output = parser.add_mutually_exclusive_group()
group_output.add_argument('--debug', action='store_true', help='Enable debug output')
group_output.add_argument('--ide', action='store_true', help='Output machine-readable results for use by IDEs')
Expand All @@ -465,7 +466,7 @@ def main():

if not args.paths:
print 'No files were provided, not doing anything'
sys_exit(0)
return 0

for path in args.paths:
for filename in glob(path):
Expand All @@ -485,6 +486,9 @@ def main():
print
print '%d problems found in total' % problems_found

if args.ignore_problems_on_exit:
return 0

if problems_found:
return 1

Expand Down

0 comments on commit 69a982e

Please sign in to comment.