You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Test file to trigger an useless-suppression error msg"""
# pylint: disable=broad-except
pass
Current behavior
Result of pylint --fail-on=useless-suppression a.py:
************* Module useless_suppression
tests/examples/useless_suppression.py:2:0: I0021: Useless suppression of 'broad-except' (useless-suppression)
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
However this process finishes with exit code 0:
> echo $?
0
Expected behavior
pylint should have a non-zero return code since a failing issue was matched. However when failing matches occur the behavor is to exit with self.linter.msg_status, unfortunately this is zero if only "info" type issues have occurred.
Duplicate of #4296 that you opened yourself and #3363 in which you participated ? If you're interested in the issue you can open a merge request, but opening more issues is not going to make the problem fix itself.
So I'm not certain that this is an exact duplicate since this is specifically about the --fail-on option, although the root cause is certainly very similar. I've submit my merge request #4713 referencing these as you suggested.
Steps to reproduce
Run:
pylint --fail-on=useless-suppression a.py
When
a.py
contains:Current behavior
Result of
pylint --fail-on=useless-suppression a.py
:However this process finishes with exit code
0
:Expected behavior
pylint should have a non-zero return code since a failing issue was matched. However when failing matches occur the behavor is to exit with
self.linter.msg_status
, unfortunately this is zero if only "info" type issues have occurred.pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: