Problem statement
Bug description
A traceback is printed when an unrecognized option is passed to pylint.
Configuration
_No response_
Command used
pylint -QPylint output
************* Module Command line
Command line:1:0: E0015: Unrecognized option found: Q (unrecognized-option)
Traceback (most recent call last):
File "/Users/markbyrne/venv310/bin/pylint", line 33, in <module>
sys.exit(load_entry_point('pylint', 'console_scripts', 'pylint')())
File "/Users/markbyrne/programming/pylint/pylint/__init__.py", line 24, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/Users/markbyrne/programming/pylint/pylint/lint/run.py", line 135, in __init__
args = _config_initialization(
File "/Users/markbyrne/programming/pylint/pylint/config/config_initialization.py", line 85, in _config_initialization
raise _UnrecognizedOptionError(options=unrecognized_options)
pylint.config.exceptions._UnrecognizedOptionErrorExpected behavior
The top part of the current output is handy:Command line:1:0: E0015: Unrecognized option found: Q (unrecognized-option)
The traceback I don't think is expected & not user-friendly.
A usage tip, for example:
mypy -Q
usage: mypy [-h] [-v] [-V] [more options; see below]
[-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: unrecognized arguments: -QPylint version
pylint 2.14.0-dev0
astroid 2.11.3
Python 3.10.0b2 (v3.10.0b2:317314165a, May 31 2021, 10:02:22) [Clang 12.0.5 (clang-1205.0.22.9)]OS / Environment
_No response_
Additional dependencies
_No response_
The environment starts at commit
0a4204fd7555 (pylint-dev/pylint 2.14), dependencies installed and tests runnable from the first minute. You are graded by hidden tests taken from the fix that was actually merged upstream.