Skip to content

Commit 82a7f2e

Browse files
committed
Update exit code and prompt summary
Update exit code to 1 if error is found. In addition, it will now show how many errors are found if there is any. Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 9455b14 commit 82a7f2e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/attributecode/cmd.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,16 @@ def check(location):
232232
if sever in important_errors:
233233
print_errors.append((msg_format % locals()))
234234

235+
number_of_important_errors = len(print_errors)
236+
237+
for err in print_errors:
238+
print(err)
239+
235240
if print_errors:
236-
for err in print_errors:
237-
print(err)
241+
click.echo('Found %(number_of_important_errors)d errors' % locals())
238242
sys.exit(1)
239-
243+
else:
244+
click.echo('No error is found.')
240245

241246
def log_errors(errors, quiet, base_dir=False):
242247
"""

0 commit comments

Comments
 (0)