From df74d7f5b6afa307b13ba1037056414bc4716de3 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 09:59:56 +0700 Subject: [PATCH 01/17] Add example for `duplicate-argument-name` --- doc/data/messages/d/duplicate-argument-name/bad.py | 2 ++ doc/data/messages/d/duplicate-argument-name/details.rst | 1 + doc/data/messages/d/duplicate-argument-name/good.py | 2 ++ doc/data/messages/d/duplicate-argument-name/related.rst | 2 ++ 4 files changed, 7 insertions(+) create mode 100644 doc/data/messages/d/duplicate-argument-name/bad.py create mode 100644 doc/data/messages/d/duplicate-argument-name/details.rst create mode 100644 doc/data/messages/d/duplicate-argument-name/good.py create mode 100644 doc/data/messages/d/duplicate-argument-name/related.rst diff --git a/doc/data/messages/d/duplicate-argument-name/bad.py b/doc/data/messages/d/duplicate-argument-name/bad.py new file mode 100644 index 0000000000..4b0b52d491 --- /dev/null +++ b/doc/data/messages/d/duplicate-argument-name/bad.py @@ -0,0 +1,2 @@ +def get_fruits(apple, banana, apple): # [duplicate-argument-name] + pass \ No newline at end of file diff --git a/doc/data/messages/d/duplicate-argument-name/details.rst b/doc/data/messages/d/duplicate-argument-name/details.rst new file mode 100644 index 0000000000..64c61c7be6 --- /dev/null +++ b/doc/data/messages/d/duplicate-argument-name/details.rst @@ -0,0 +1 @@ +Duplicate argument names in function definitions are syntax errors. diff --git a/doc/data/messages/d/duplicate-argument-name/good.py b/doc/data/messages/d/duplicate-argument-name/good.py new file mode 100644 index 0000000000..9fe6d73e57 --- /dev/null +++ b/doc/data/messages/d/duplicate-argument-name/good.py @@ -0,0 +1,2 @@ +def get_fruits(apple, banana, orange): + pass diff --git a/doc/data/messages/d/duplicate-argument-name/related.rst b/doc/data/messages/d/duplicate-argument-name/related.rst new file mode 100644 index 0000000000..4b05fffbce --- /dev/null +++ b/doc/data/messages/d/duplicate-argument-name/related.rst @@ -0,0 +1,2 @@ +`Testcases `_ +`Issue Tracker ` \ No newline at end of file From 16a22edd23b0f10dab4b6358c68867de84539fad Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:03:59 +0700 Subject: [PATCH 02/17] add new line in bad.py --- doc/data/messages/d/duplicate-argument-name/bad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/d/duplicate-argument-name/bad.py b/doc/data/messages/d/duplicate-argument-name/bad.py index 4b0b52d491..4c9c5859a1 100644 --- a/doc/data/messages/d/duplicate-argument-name/bad.py +++ b/doc/data/messages/d/duplicate-argument-name/bad.py @@ -1,2 +1,2 @@ def get_fruits(apple, banana, apple): # [duplicate-argument-name] - pass \ No newline at end of file + pass From cc13ae2c1ccbb68a77e64b625ec9ef06c050e842 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:06:30 +0700 Subject: [PATCH 03/17] fix Issue Tracker link --- doc/data/messages/d/duplicate-argument-name/related.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/d/duplicate-argument-name/related.rst b/doc/data/messages/d/duplicate-argument-name/related.rst index 4b05fffbce..7fc8efc2db 100644 --- a/doc/data/messages/d/duplicate-argument-name/related.rst +++ b/doc/data/messages/d/duplicate-argument-name/related.rst @@ -1,2 +1,2 @@ `Testcases `_ -`Issue Tracker ` \ No newline at end of file +`Issue Tracker _` \ No newline at end of file From d632fadbafc2fcf78c5568b0b40b525e3f6932cd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 03:37:38 +0000 Subject: [PATCH 04/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/data/messages/d/duplicate-argument-name/related.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/d/duplicate-argument-name/related.rst b/doc/data/messages/d/duplicate-argument-name/related.rst index 7fc8efc2db..3a4a67bc02 100644 --- a/doc/data/messages/d/duplicate-argument-name/related.rst +++ b/doc/data/messages/d/duplicate-argument-name/related.rst @@ -1,2 +1,2 @@ `Testcases `_ -`Issue Tracker _` \ No newline at end of file +`Issue Tracker _` From 851f43a6dc7ea44edcfdb0b8d19f16b0ac167158 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:40:25 +0700 Subject: [PATCH 05/17] fix link issue and add error --- doc/data/messages/d/duplicate-argument-name/details.rst | 9 +++++++++ doc/data/messages/d/duplicate-argument-name/related.rst | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/data/messages/d/duplicate-argument-name/details.rst b/doc/data/messages/d/duplicate-argument-name/details.rst index 64c61c7be6..caa1e0707d 100644 --- a/doc/data/messages/d/duplicate-argument-name/details.rst +++ b/doc/data/messages/d/duplicate-argument-name/details.rst @@ -1 +1,10 @@ Duplicate argument names in function definitions are syntax errors. + +.. code:: python + + >>> def get_fruits(apple, banana, apple): # [duplicate-argument-name] + ... pass + ... + File "", line 1 + SyntaxError: duplicate argument 'apple' in function definition + >>> diff --git a/doc/data/messages/d/duplicate-argument-name/related.rst b/doc/data/messages/d/duplicate-argument-name/related.rst index 7fc8efc2db..8c73e5fbfc 100644 --- a/doc/data/messages/d/duplicate-argument-name/related.rst +++ b/doc/data/messages/d/duplicate-argument-name/related.rst @@ -1,2 +1,2 @@ `Testcases `_ -`Issue Tracker _` \ No newline at end of file +`Issue Tracker `_ \ No newline at end of file From 75182717e75af06009e76fcdc126f06174bb28b3 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:43:20 +0700 Subject: [PATCH 06/17] fix repl symbol --- doc/data/messages/d/duplicate-argument-name/details.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/data/messages/d/duplicate-argument-name/details.rst b/doc/data/messages/d/duplicate-argument-name/details.rst index caa1e0707d..1984d4981f 100644 --- a/doc/data/messages/d/duplicate-argument-name/details.rst +++ b/doc/data/messages/d/duplicate-argument-name/details.rst @@ -1,10 +1,9 @@ Duplicate argument names in function definitions are syntax errors. .. code:: python - + >>> def get_fruits(apple, banana, apple): # [duplicate-argument-name] ... pass ... File "", line 1 SyntaxError: duplicate argument 'apple' in function definition - >>> From afc054f7cce063b54498c76218a69088b48d0459 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:51:44 +0700 Subject: [PATCH 07/17] remove duplicate information --- doc/data/messages/d/duplicate-argument-name/details.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/data/messages/d/duplicate-argument-name/details.rst b/doc/data/messages/d/duplicate-argument-name/details.rst index 1984d4981f..0c99e08f4b 100644 --- a/doc/data/messages/d/duplicate-argument-name/details.rst +++ b/doc/data/messages/d/duplicate-argument-name/details.rst @@ -1,5 +1,3 @@ -Duplicate argument names in function definitions are syntax errors. - .. code:: python >>> def get_fruits(apple, banana, apple): # [duplicate-argument-name] From f1790157b6e7e3ee1ccff0da58e4e95c855cc9b7 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:58:08 +0700 Subject: [PATCH 08/17] add `.contributors_aliases.json` --- script/.contributors_aliases.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index 50f879ed06..dbff55ca24 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -563,5 +563,9 @@ "vladtemian@gmail.com": { "mails": ["vladtemian@gmail.com"], "name": "Vlad Temian" + }, + "gunungpambudiw@gmail.com": { + "mails": ["gunungpambudiw@gmail.com"], + "name": "Gunung Pambudi W." } } From 397e169c7b5764e038643288234f2a51fa6f4fef Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 12:06:07 +0700 Subject: [PATCH 09/17] Add example for `duplicate-bases` message documentation --- doc/data/messages/d/duplicate-bases/bad.py | 6 ++++++ doc/data/messages/d/duplicate-bases/details.rst | 7 +++++++ doc/data/messages/d/duplicate-bases/good.py | 10 ++++++++++ doc/data/messages/d/duplicate-bases/related.rst | 1 + 4 files changed, 24 insertions(+) create mode 100644 doc/data/messages/d/duplicate-bases/bad.py create mode 100644 doc/data/messages/d/duplicate-bases/details.rst create mode 100644 doc/data/messages/d/duplicate-bases/good.py create mode 100644 doc/data/messages/d/duplicate-bases/related.rst diff --git a/doc/data/messages/d/duplicate-bases/bad.py b/doc/data/messages/d/duplicate-bases/bad.py new file mode 100644 index 0000000000..30dff921f7 --- /dev/null +++ b/doc/data/messages/d/duplicate-bases/bad.py @@ -0,0 +1,6 @@ +class Animal: + pass + + +class Cat(Animal, Animal): + pass diff --git a/doc/data/messages/d/duplicate-bases/details.rst b/doc/data/messages/d/duplicate-bases/details.rst new file mode 100644 index 0000000000..b03c9cc115 --- /dev/null +++ b/doc/data/messages/d/duplicate-bases/details.rst @@ -0,0 +1,7 @@ +.. code:: shell-session + + > python bad.py + Traceback (most recent call last): + File "C:\pylint\doc\data\messages\d\duplicate-bases\bad.py", line 5, in + class Cat(Animal, Animal): + TypeError: duplicate base class Animal diff --git a/doc/data/messages/d/duplicate-bases/good.py b/doc/data/messages/d/duplicate-bases/good.py new file mode 100644 index 0000000000..8ed25950c2 --- /dev/null +++ b/doc/data/messages/d/duplicate-bases/good.py @@ -0,0 +1,10 @@ +class Animal: + pass + + +class Bird(Animal): + pass + + +class Cat(Animal): + pass diff --git a/doc/data/messages/d/duplicate-bases/related.rst b/doc/data/messages/d/duplicate-bases/related.rst new file mode 100644 index 0000000000..5c7fd73bd8 --- /dev/null +++ b/doc/data/messages/d/duplicate-bases/related.rst @@ -0,0 +1 @@ +`Issue Tracker `_ \ No newline at end of file From 5237bf3b482ab041ce399b797d752ac5cec747d8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 05:10:09 +0000 Subject: [PATCH 10/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/data/messages/d/duplicate-bases/details.rst | 2 +- doc/data/messages/d/duplicate-bases/related.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/data/messages/d/duplicate-bases/details.rst b/doc/data/messages/d/duplicate-bases/details.rst index b03c9cc115..6393ab6561 100644 --- a/doc/data/messages/d/duplicate-bases/details.rst +++ b/doc/data/messages/d/duplicate-bases/details.rst @@ -1,5 +1,5 @@ .. code:: shell-session - + > python bad.py Traceback (most recent call last): File "C:\pylint\doc\data\messages\d\duplicate-bases\bad.py", line 5, in diff --git a/doc/data/messages/d/duplicate-bases/related.rst b/doc/data/messages/d/duplicate-bases/related.rst index 5c7fd73bd8..33088715f7 100644 --- a/doc/data/messages/d/duplicate-bases/related.rst +++ b/doc/data/messages/d/duplicate-bases/related.rst @@ -1 +1 @@ -`Issue Tracker `_ \ No newline at end of file +`Issue Tracker `_ From 52ea6ae5df255fa588294ebfc8618313f3cc4b14 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 12:10:15 +0700 Subject: [PATCH 11/17] delete other file --- doc/data/messages/d/duplicate-argument-name/bad.py | 2 -- doc/data/messages/d/duplicate-argument-name/details.rst | 7 ------- doc/data/messages/d/duplicate-argument-name/good.py | 2 -- doc/data/messages/d/duplicate-argument-name/related.rst | 2 -- 4 files changed, 13 deletions(-) delete mode 100644 doc/data/messages/d/duplicate-argument-name/bad.py delete mode 100644 doc/data/messages/d/duplicate-argument-name/details.rst delete mode 100644 doc/data/messages/d/duplicate-argument-name/good.py delete mode 100644 doc/data/messages/d/duplicate-argument-name/related.rst diff --git a/doc/data/messages/d/duplicate-argument-name/bad.py b/doc/data/messages/d/duplicate-argument-name/bad.py deleted file mode 100644 index 4c9c5859a1..0000000000 --- a/doc/data/messages/d/duplicate-argument-name/bad.py +++ /dev/null @@ -1,2 +0,0 @@ -def get_fruits(apple, banana, apple): # [duplicate-argument-name] - pass diff --git a/doc/data/messages/d/duplicate-argument-name/details.rst b/doc/data/messages/d/duplicate-argument-name/details.rst deleted file mode 100644 index 0c99e08f4b..0000000000 --- a/doc/data/messages/d/duplicate-argument-name/details.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. code:: python - - >>> def get_fruits(apple, banana, apple): # [duplicate-argument-name] - ... pass - ... - File "", line 1 - SyntaxError: duplicate argument 'apple' in function definition diff --git a/doc/data/messages/d/duplicate-argument-name/good.py b/doc/data/messages/d/duplicate-argument-name/good.py deleted file mode 100644 index 9fe6d73e57..0000000000 --- a/doc/data/messages/d/duplicate-argument-name/good.py +++ /dev/null @@ -1,2 +0,0 @@ -def get_fruits(apple, banana, orange): - pass diff --git a/doc/data/messages/d/duplicate-argument-name/related.rst b/doc/data/messages/d/duplicate-argument-name/related.rst deleted file mode 100644 index ea5927c01c..0000000000 --- a/doc/data/messages/d/duplicate-argument-name/related.rst +++ /dev/null @@ -1,2 +0,0 @@ -`Testcases `_ -`Issue Tracker `_ From 71ac2b84ea92c5ee1accc157db7cd7ffabeb8c85 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 12:12:08 +0700 Subject: [PATCH 12/17] fix contributor list --- script/.contributors_aliases.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/script/.contributors_aliases.json b/script/.contributors_aliases.json index dbff55ca24..50f879ed06 100644 --- a/script/.contributors_aliases.json +++ b/script/.contributors_aliases.json @@ -563,9 +563,5 @@ "vladtemian@gmail.com": { "mails": ["vladtemian@gmail.com"], "name": "Vlad Temian" - }, - "gunungpambudiw@gmail.com": { - "mails": ["gunungpambudiw@gmail.com"], - "name": "Gunung Pambudi W." } } From d6a454836d0ccecf026ac7f559b0264d91b619c9 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:43:43 +0700 Subject: [PATCH 13/17] Delete related.rst remove unreliable link --- doc/data/messages/d/duplicate-bases/related.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/data/messages/d/duplicate-bases/related.rst diff --git a/doc/data/messages/d/duplicate-bases/related.rst b/doc/data/messages/d/duplicate-bases/related.rst deleted file mode 100644 index 33088715f7..0000000000 --- a/doc/data/messages/d/duplicate-bases/related.rst +++ /dev/null @@ -1 +0,0 @@ -`Issue Tracker `_ From 69cd78da6b447608cd9ea022dd5ea2d697793a28 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:53:04 +0700 Subject: [PATCH 14/17] Update class_checker.py add `duplicate-bases` description --- pylint/checkers/classes/class_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index a426b99601..55f19105cb 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -613,7 +613,7 @@ def _has_same_layout_slots(slots, assigned_value): "E0241": ( "Duplicate bases for class %r", "duplicate-bases", - "Used when a class has duplicate bases.", + "Duplicate use of base class in derived class are TypeError.", ), "E0242": ( "Value %r in slots conflicts with class variable", From a09a2b0b287669f9eacd9dee44b0ef7e36058452 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:55:33 +0700 Subject: [PATCH 15/17] Delete details.rst move error message to description in `class_checker.py` --- doc/data/messages/d/duplicate-bases/details.rst | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 doc/data/messages/d/duplicate-bases/details.rst diff --git a/doc/data/messages/d/duplicate-bases/details.rst b/doc/data/messages/d/duplicate-bases/details.rst deleted file mode 100644 index 6393ab6561..0000000000 --- a/doc/data/messages/d/duplicate-bases/details.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. code:: shell-session - - > python bad.py - Traceback (most recent call last): - File "C:\pylint\doc\data\messages\d\duplicate-bases\bad.py", line 5, in - class Cat(Animal, Animal): - TypeError: duplicate base class Animal From ba8a46ae206b18c33bd9554624f83d29199958ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:56:39 +0200 Subject: [PATCH 16/17] Update pylint/checkers/classes/class_checker.py --- pylint/checkers/classes/class_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index 55f19105cb..9f90a02e40 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -613,7 +613,7 @@ def _has_same_layout_slots(slots, assigned_value): "E0241": ( "Duplicate bases for class %r", "duplicate-bases", - "Duplicate use of base class in derived class are TypeError.", + "Duplicate use of base classes in derived classes raise TypeErrors.", ), "E0242": ( "Value %r in slots conflicts with class variable", From 350f54eb7d3bf97b3e0fd85df6f43c53d1ead4d1 Mon Sep 17 00:00:00 2001 From: "Gunung P. Wibisono" <55311527+gunungpw@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:06:39 +0700 Subject: [PATCH 17/17] Update doc/data/messages/d/duplicate-bases/bad.py Co-authored-by: Pierre Sassoulas --- doc/data/messages/d/duplicate-bases/bad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/data/messages/d/duplicate-bases/bad.py b/doc/data/messages/d/duplicate-bases/bad.py index 30dff921f7..a68e3903df 100644 --- a/doc/data/messages/d/duplicate-bases/bad.py +++ b/doc/data/messages/d/duplicate-bases/bad.py @@ -2,5 +2,5 @@ class Animal: pass -class Cat(Animal, Animal): +class Cat(Animal, Animal): # [duplicate-bases] pass