Skip to content

Commit 78f409a

Browse files
authored
Merge pull request #893 from oliv3r/filtered_warnings
[Fixed] --fail-on-warnings respect filters by default [Added] --fail-on-ignored also applies to --fail-on-warnings
2 parents 479f674 + 7648d4e commit 78f409a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

kibot/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def main():
669669
if args.fail_on_ignored and (GS.errors_ignored or log.errors_ignored):
670670
exit(IGNORED_ERRORS)
671671

672-
if args.fail_on_warnings and logger.got_warnings():
672+
if args.fail_on_warnings and logger.got_warnings(args.fail_on_ignored):
673673
exit(GOT_WARNINGS)
674674

675675

kibot/log.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,11 @@ def log_totals(self):
203203
filt_msg = ', {} filtered'.format(MyLogger.n_filtered)
204204
self.info('Found {} unique warning/s ({} total{})'.format(MyLogger.warn_cnt, MyLogger.warn_tcnt, filt_msg))
205205

206-
def got_warnings(self):
207-
return MyLogger.warn_cnt or MyLogger.warn_tcnt
206+
def got_warnings(self, fail_on_ignored=False):
207+
if fail_on_ignored:
208+
return MyLogger.warn_tcnt
209+
else:
210+
return MyLogger.warn_cnt
208211

209212
def non_critical_error(self, msg, *args, **kwargs):
210213
buf = str(msg)

0 commit comments

Comments
 (0)