File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ What's New in Pylint 2.14.5?
6
6
Release date: TBA
7
7
8
8
9
+ * Fixed handling of ``-- `` as separator between positional arguments and flags.
10
+
11
+ Closes #7003
9
12
10
13
What's New in Pylint 2.14.4?
11
14
----------------------------
Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ def _config_initialization(
76
76
unrecognized_options : list [str ] = []
77
77
for opt in parsed_args_list :
78
78
if opt .startswith ("--" ):
79
- unrecognized_options .append (opt [2 :])
79
+ if len (opt ) > 2 :
80
+ unrecognized_options .append (opt [2 :])
80
81
elif opt .startswith ("-" ):
81
82
unrecognized_options .append (opt [1 :])
82
83
if unrecognized_options :
Original file line number Diff line number Diff line change @@ -116,3 +116,13 @@ def test_short_verbose(capsys: CaptureFixture) -> None:
116
116
Run ([str (EMPTY_MODULE ), "-v" ], exit = False )
117
117
output = capsys .readouterr ()
118
118
assert "Using config file" in output .err
119
+
120
+
121
+ def test_argument_separator (capsys : CaptureFixture ) -> None :
122
+ """Check that we support using '--' to separate argument types.
123
+
124
+ Reported in https://github.com/PyCQA/pylint/issues/7003.
125
+ """
126
+ Run (["--" , str (EMPTY_MODULE )], exit = False )
127
+ output = capsys .readouterr ()
128
+ assert not output .err
You can’t perform that action at this time.
0 commit comments