From 8a92b09b984c625ad497377657871a3911962c91 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 4 Dec 2023 10:39:27 +0100 Subject: [PATCH 1/2] Reserve 'too-many-positional' / 'R0917' for later use See https://github.com/astral-sh/ruff/issues/8946 Refs #9099 --- pylint/checkers/design_analysis.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index cb64e0a9ba..97623feae8 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -81,6 +81,13 @@ "too-many-boolean-expressions", "Used when an if statement contains too many boolean expressions.", ), + "R0917": ( + "Too many positional arguments in a function call.", + "too-many-positional", + "Will be implemented in https://github.com/pylint-dev/pylint/issues/9099," + "msgid/symbol pair reserved for compatibility with ruff, " + "see https://github.com/astral-sh/ruff/issues/8946.", + ), } SPECIAL_OBJ = re.compile("^_{2}[a-z]+_{2}$") DATACLASSES_DECORATORS = frozenset({"dataclass", "attrs"}) From 99eb83127d87771f8aab71ff78c44b2b3edb8df7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 4 Dec 2023 12:59:41 +0100 Subject: [PATCH 2/2] Add mandatory doc --- doc/data/messages/t/too-many-positional/details.rst | 1 + doc/data/messages/t/too-many-positional/related.rst | 2 ++ doc/user_guide/checkers/features.rst | 4 ++++ doc/user_guide/messages/messages_overview.rst | 1 + 4 files changed, 8 insertions(+) create mode 100644 doc/data/messages/t/too-many-positional/details.rst create mode 100644 doc/data/messages/t/too-many-positional/related.rst diff --git a/doc/data/messages/t/too-many-positional/details.rst b/doc/data/messages/t/too-many-positional/details.rst new file mode 100644 index 0000000000..b9acd905f0 --- /dev/null +++ b/doc/data/messages/t/too-many-positional/details.rst @@ -0,0 +1 @@ +Reserved message name, not yet implemented. diff --git a/doc/data/messages/t/too-many-positional/related.rst b/doc/data/messages/t/too-many-positional/related.rst new file mode 100644 index 0000000000..4db259748f --- /dev/null +++ b/doc/data/messages/t/too-many-positional/related.rst @@ -0,0 +1,2 @@ +- `Ruff discussion `_ +- `Pylint issue `_ diff --git a/doc/user_guide/checkers/features.rst b/doc/user_guide/checkers/features.rst index cd900b9943..84b967a82c 100644 --- a/doc/user_guide/checkers/features.rst +++ b/doc/user_guide/checkers/features.rst @@ -431,6 +431,10 @@ Design checker Messages simpler (and so easier to use) class. :too-many-locals (R0914): *Too many local variables (%s/%s)* Used when a function or method has too many local variables. +:too-many-positional (R0917): *Too many positional arguments in a function call.* + Will be implemented in https://github.com/pylint- + dev/pylint/issues/9099,msgid/symbol pair reserved for compatibility with + ruff, see https://github.com/astral-sh/ruff/issues/8946. :too-many-public-methods (R0904): *Too many public methods (%s/%s)* Used when class has too many public methods, try to reduce this to get a simpler (and so easier to use) class. diff --git a/doc/user_guide/messages/messages_overview.rst b/doc/user_guide/messages/messages_overview.rst index 25073d4caf..8d9f197502 100644 --- a/doc/user_guide/messages/messages_overview.rst +++ b/doc/user_guide/messages/messages_overview.rst @@ -532,6 +532,7 @@ All messages in the refactor category: refactor/too-many-instance-attributes refactor/too-many-locals refactor/too-many-nested-blocks + refactor/too-many-positional refactor/too-many-public-methods refactor/too-many-return-statements refactor/too-many-statements