From 08be5bf7b274410eb40d67d34d3f5d69f3098e67 Mon Sep 17 00:00:00 2001 From: James Adams Date: Mon, 26 Nov 2018 10:53:43 +0000 Subject: [PATCH] panlint: Provide print summary option Only print the summary if the option is set. --- panc/src/main/scripts/panlint/panlint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panc/src/main/scripts/panlint/panlint.py b/panc/src/main/scripts/panlint/panlint.py index 77d065f9..1610fa83 100755 --- a/panc/src/main/scripts/panlint/panlint.py +++ b/panc/src/main/scripts/panlint/panlint.py @@ -524,6 +524,7 @@ def main(): parser.add_argument('paths', metavar='PATH', type=str, nargs='*', help='Paths of files to check') 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('--summary', action='store_true', help='Display a summary of problems') parser.add_argument('--allow_mvn_templates', action='store_true', help='Allow use of maven templates') parser.add_argument('--always_exit_success', action='store_true', help='Always exit cleanly even if problems are found') @@ -571,7 +572,9 @@ def main(): print('\nProblem count per file:') print(filestats_table(problem_stats)) - print('\n%d problems found in %d lines' % (problem_count, len(problem_lines))) + if args.summary: + print() + print(f"\n{problem_count} problems found in {len(problem_lines)} lines") if args.always_exit_success: return 0