Skip to content

Commit

Permalink
Accept a comma-separated list of messages IDs in --help-msg (#7490)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored Sep 19, 2022
1 parent 36e1238 commit a5c8e23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/7471.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
``--help-msg`` now accepts a comma-separated list of message IDs again.

Closes #7471
6 changes: 5 additions & 1 deletion pylint/config/callback_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ def __call__(
option_string: str | None = "--help-msg",
) -> None:
assert isinstance(values, (list, tuple))
self.run.linter.msgs_store.help_message(values)
values_to_print: list[str] = []
for msg in values:
assert isinstance(msg, str)
values_to_print += utils._check_csv(msg)
self.run.linter.msgs_store.help_message(values_to_print)
sys.exit(0)


Expand Down
1 change: 1 addition & 0 deletions tests/test_self.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ def test_output_of_callback_options(
[["--help-msg", "W0101"], ":unreachable (W0101)", False],
[["--help-msg", "WX101"], "No such message id", False],
[["--help-msg"], "--help-msg: expected at least one argumen", True],
[["--help-msg", "C0102,C0103"], ":invalid-name (C0103):", False],
],
)
def test_help_msg(
Expand Down

0 comments on commit a5c8e23

Please sign in to comment.