Skip to content

Commit 2c76860

Browse files
committed
Apply corrections
Used message.C directly instead of slicing again, improved feature notes and removed unecessary output from locally run pre-commit pylint hook. It was kept for the manual stage since that is run on Github and needs it to annotate code on PRs.
1 parent a0502b0 commit 2c76860

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ repos:
7777
entry: pylint
7878
language: system
7979
types: [python]
80-
args:
81-
["-rn", "-sn", "--rcfile=pylintrc", "--fail-on=I", "--output-format=github"]
80+
args: ["-rn", "-sn", "--rcfile=pylintrc", "--fail-on=I"]
8281
exclude: tests(/\w*)*/functional/|tests/input|tests(/\w*)*data/|doc/
8382
# We define an additional manual step to allow running pylint with a spelling
8483
# checker in CI.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
A new `github` reporter has been added. This reporter automatically annotates code on GitHub's user interface
2-
with the messages found during linting. Use it with `pylint --output-format=github`.
1+
A new `github` reporter has been added. This reporter returns the output of `pylint` in a format that
2+
Github can use to automatically annotate code. Use it with `pylint --output-format=github` on your Github Workflows.
33

44
Closes #9443.

pylint/reporters/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def write_message(self, msg: Message) -> None:
276276
for key in ("end_line", "end_column"):
277277
self_dict[key] = self_dict[key] or ""
278278

279-
self_dict["category"] = self.category_map.get(msg.msg_id[:1]) or "error"
279+
self_dict["category"] = self.category_map.get(msg.C) or "error"
280280
self.writeln(self._fixed_template.format(**self_dict))
281281

282282

0 commit comments

Comments
 (0)