Skip to content

Commit fbc9e66

Browse files
DanielNoordPierre-Sassoulas
authored andcommitted
Accept a comma-separated list of messages IDs in --help-msg (#7490)
1 parent fe3436e commit fbc9e66

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

doc/whatsnew/fragments/7471.bugfix

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``--help-msg`` now accepts a comma-separated list of message IDs again.
2+
3+
Closes #7471

pylint/config/callback_actions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ def __call__(
158158
option_string: str | None = "--help-msg",
159159
) -> None:
160160
assert isinstance(values, (list, tuple))
161-
self.run.linter.msgs_store.help_message(values)
161+
values_to_print: list[str] = []
162+
for msg in values:
163+
assert isinstance(msg, str)
164+
values_to_print += utils._check_csv(msg)
165+
self.run.linter.msgs_store.help_message(values_to_print)
162166
sys.exit(0)
163167

164168

tests/test_self.py

+1
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ def test_output_of_callback_options(
12291229
[["--help-msg", "W0101"], ":unreachable (W0101)", False],
12301230
[["--help-msg", "WX101"], "No such message id", False],
12311231
[["--help-msg"], "--help-msg: expected at least one argumen", True],
1232+
[["--help-msg", "C0102,C0103"], ":invalid-name (C0103):", False],
12321233
],
12331234
)
12341235
def test_help_msg(

0 commit comments

Comments
 (0)