From e507a4d87ec80e706ac0c8ce2d23bd28006cbbbc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:50:25 +0000 Subject: Fix a false positive for ``bad-dunder-name`` when there is a user-defined ``__index__`` method. (#8619) (#8622) Closes #8613 (cherry picked from commit f223c6de3a39eae6d1c76e30b55da28639dd8777) Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> --- doc/whatsnew/fragments/8613.false_positive | 3 +++ pylint/constants.py | 1 + tests/functional/ext/bad_dunder/bad_dunder_name.py | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 doc/whatsnew/fragments/8613.false_positive diff --git a/doc/whatsnew/fragments/8613.false_positive b/doc/whatsnew/fragments/8613.false_positive new file mode 100644 index 000000000..80d28e9c2 --- /dev/null +++ b/doc/whatsnew/fragments/8613.false_positive @@ -0,0 +1,3 @@ +Fix a false positive for ``bad-dunder-name`` when there is a user-defined ``__index__`` method. + +Closes #8613 diff --git a/pylint/constants.py b/pylint/constants.py index ad7fc2256..de29fb9b8 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -281,6 +281,7 @@ EXTRA_DUNDER_METHODS = [ "__getnewargs_ex__", "__getnewargs__", "__getstate__", + "__index__", "__setstate__", "__reduce__", "__reduce_ex__", diff --git a/tests/functional/ext/bad_dunder/bad_dunder_name.py b/tests/functional/ext/bad_dunder/bad_dunder_name.py index 48247aba0..6008866b1 100644 --- a/tests/functional/ext/bad_dunder/bad_dunder_name.py +++ b/tests/functional/ext/bad_dunder/bad_dunder_name.py @@ -49,6 +49,9 @@ class Apples: def __doc__(self): return "Docstring" + def __index__(self): + return 1 + def __increase_me__(val): return val + 1 -- cgit v1.2.1 From 4350c6fd7a955892712e2bf7a78adf4531e483b4 Mon Sep 17 00:00:00 2001 From: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> Date: Thu, 27 Apr 2023 19:14:11 +0200 Subject: Added escaping of vertical bar character in annotation labels (#8610) (#8631) --- doc/whatsnew/fragments/8603.bugfix | 3 +++ pylint/pyreverse/dot_printer.py | 10 +++++++++- tests/data/nullable_pattern.py | 10 ++++++++++ tests/pyreverse/data/classes_No_Name.dot | 1 + tests/pyreverse/data/classes_No_Name.html | 6 +++++- tests/pyreverse/data/classes_No_Name.mmd | 4 ++++ tests/pyreverse/data/classes_No_Name.puml | 4 ++++ tests/pyreverse/data/classes_No_Name.vcg | 29 +++++++++++++++------------- tests/pyreverse/data/classes_colorized.dot | 1 + tests/pyreverse/data/classes_colorized.puml | 4 ++++ tests/pyreverse/data/packages_No_Name.dot | 1 + tests/pyreverse/data/packages_No_Name.html | 4 +++- tests/pyreverse/data/packages_No_Name.mmd | 2 ++ tests/pyreverse/data/packages_No_Name.puml | 6 ++---- tests/pyreverse/data/packages_No_Name.vcg | 13 ++++++++----- tests/pyreverse/data/packages_colorized.dot | 1 + tests/pyreverse/data/packages_colorized.puml | 3 +++ tests/pyreverse/test_diadefs.py | 2 ++ tests/pyreverse/test_inspector.py | 1 + 19 files changed, 80 insertions(+), 25 deletions(-) create mode 100644 doc/whatsnew/fragments/8603.bugfix create mode 100644 tests/data/nullable_pattern.py diff --git a/doc/whatsnew/fragments/8603.bugfix b/doc/whatsnew/fragments/8603.bugfix new file mode 100644 index 000000000..1a1025c4b --- /dev/null +++ b/doc/whatsnew/fragments/8603.bugfix @@ -0,0 +1,3 @@ +``pyreverse``: added escaping of vertical bar character in annotation labels produced by DOT printer to ensure it is not treated as field separator of record-based nodes. + +Closes #8603 diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py index 077e0552d..99cb17e97 100644 --- a/pylint/pyreverse/dot_printer.py +++ b/pylint/pyreverse/dot_printer.py @@ -121,11 +121,19 @@ class DotPrinter(Printer): ) label += rf"{method_name}({', '.join(args)})" if func.returns: - label += ": " + get_annotation_label(func.returns) + annotation_label = get_annotation_label(func.returns) + label += ": " + self._escape_annotation_label(annotation_label) label += rf"{HTMLLabels.LINEBREAK_LEFT.value}" label += "}" return label + def _escape_annotation_label(self, annotation_label: str) -> str: + # Escape vertical bar characters to make them appear as a literal characters + # otherwise it gets treated as field separator of record-based nodes + annotation_label = annotation_label.replace("|", r"\|") + + return annotation_label + def emit_edge( self, from_node: str, diff --git a/tests/data/nullable_pattern.py b/tests/data/nullable_pattern.py new file mode 100644 index 000000000..bd730bbd6 --- /dev/null +++ b/tests/data/nullable_pattern.py @@ -0,0 +1,10 @@ +""" docstring for file nullable_pattern.py """ +from typing import Optional + +class NullablePatterns: + def return_nullable_1(self) -> int | None: + """ Nullable return type using the | operator as mentioned in PEP 604, see https://peps.python.org/pep-0604 """ + pass + + def return_nullable_2(self) -> Optional[int]: + pass diff --git a/tests/pyreverse/data/classes_No_Name.dot b/tests/pyreverse/data/classes_No_Name.dot index a598ab6d9..2e8830fa0 100644 --- a/tests/pyreverse/data/classes_No_Name.dot +++ b/tests/pyreverse/data/classes_No_Name.dot @@ -7,6 +7,7 @@ charset="utf-8" "data.suppliermodule_test.DoNothing2" [color="black", fontcolor="black", label=<{DoNothing2|
|}>, shape="record", style="solid"]; "data.suppliermodule_test.DoSomething" [color="black", fontcolor="black", label=<{DoSomething|my_int : Optional[int]
my_int_2 : Optional[int]
my_string : str
|do_it(new_int: int): int
}>, shape="record", style="solid"]; "data.suppliermodule_test.Interface" [color="black", fontcolor="black", label=<{Interface|
|get_value()
set_value(value)
}>, shape="record", style="solid"]; +"data.nullable_pattern.NullablePatterns" [color="black", fontcolor="black", label=<{NullablePatterns|
|return_nullable_1(): int \| None
return_nullable_2(): Optional[int]
}>, shape="record", style="solid"]; "data.property_pattern.PropertyPatterns" [color="black", fontcolor="black", label=<{PropertyPatterns|prop1
prop2
|}>, shape="record", style="solid"]; "data.clientmodule_test.Specialization" [color="black", fontcolor="black", label=<{Specialization|TYPE : str
relation
relation2
top : str
|from_value(value: int)
increment_value(): None
transform_value(value: int): int
}>, shape="record", style="solid"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; diff --git a/tests/pyreverse/data/classes_No_Name.html b/tests/pyreverse/data/classes_No_Name.html index 602f2e3b7..bed9a8d14 100644 --- a/tests/pyreverse/data/classes_No_Name.html +++ b/tests/pyreverse/data/classes_No_Name.html @@ -26,6 +26,10 @@ get_value()* set_value(value)* } + class NullablePatterns { + return_nullable_1()* int | None + return_nullable_2()* Optional[int] + } class PropertyPatterns { prop1 prop2 @@ -44,7 +48,7 @@ DoNothing --* Ancestor : cls_member DoNothing --* Specialization : relation DoNothing2 --o Specialization : relation2 - + diff --git a/tests/pyreverse/data/classes_No_Name.mmd b/tests/pyreverse/data/classes_No_Name.mmd index 1db88b2ae..53cb4fc3c 100644 --- a/tests/pyreverse/data/classes_No_Name.mmd +++ b/tests/pyreverse/data/classes_No_Name.mmd @@ -21,6 +21,10 @@ classDiagram get_value()* set_value(value)* } + class NullablePatterns { + return_nullable_1()* int | None + return_nullable_2()* Optional[int] + } class PropertyPatterns { prop1 prop2 diff --git a/tests/pyreverse/data/classes_No_Name.puml b/tests/pyreverse/data/classes_No_Name.puml index 837e6865c..e4d06a00c 100644 --- a/tests/pyreverse/data/classes_No_Name.puml +++ b/tests/pyreverse/data/classes_No_Name.puml @@ -22,6 +22,10 @@ class "Interface" as data.suppliermodule_test.Interface { {abstract}get_value() {abstract}set_value(value) } +class "NullablePatterns" as data.nullable_pattern.NullablePatterns { + {abstract}return_nullable_1() -> int | None + {abstract}return_nullable_2() -> Optional[int] +} class "PropertyPatterns" as data.property_pattern.PropertyPatterns { prop1 prop2 diff --git a/tests/pyreverse/data/classes_No_Name.vcg b/tests/pyreverse/data/classes_No_Name.vcg index 4c792db69..712b2cec6 100644 --- a/tests/pyreverse/data/classes_No_Name.vcg +++ b/tests/pyreverse/data/classes_No_Name.vcg @@ -6,50 +6,53 @@ graph:{ manhattan_edges:yes node: {title:"data.clientmodule_test.Ancestor" label:"\fbAncestor\fn\n\f____________\n\f08attr : str\n\f08cls_member\n\f____________\n\f10get_value()\n\f10set_value()" shape:box -} + } node: {title:"data.suppliermodule_test.CustomException" label:"\fb 09CustomException\fn\n\f_________________" shape:box -} + } node: {title:"data.suppliermodule_test.DoNothing" label:"\fbDoNothing\fn\n\f___________" shape:box -} + } node: {title:"data.suppliermodule_test.DoNothing2" label:"\fbDoNothing2\fn\n\f____________" shape:box -} + } node: {title:"data.suppliermodule_test.DoSomething" label:"\fbDoSomething\fn\n\f__________________________\n\f08my_int : Optional[int]\n\f08my_int_2 : Optional[int]\n\f08my_string : str\n\f__________________________\n\f10do_it()" shape:box -} + } node: {title:"data.suppliermodule_test.Interface" label:"\fbInterface\fn\n\f___________\n\f10get_value()\n\f10set_value()" shape:box -} + } + node: {title:"data.nullable_pattern.NullablePatterns" label:"\fbNullablePatterns\fn\n\f___________________\n\f10return_nullable_1()\n\f10return_nullable_2()" + shape:box + } node: {title:"data.property_pattern.PropertyPatterns" label:"\fbPropertyPatterns\fn\n\f__________________\n\f08prop1\n\f08prop2\n\f__________________" shape:box -} + } node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f_________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f_________________\n\f10from_value()\n\f10increment_value()\n\f10transform_value()" shape:box -} + } edge: {sourcename:"data.clientmodule_test.Specialization" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid backarrowstyle:none backarrowsize:10 -} + } edge: {sourcename:"data.clientmodule_test.Ancestor" targetname:"data.suppliermodule_test.Interface" arrowstyle:solid backarrowstyle:none linestyle:dotted backarrowsize:10 -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid backarrowstyle:none textcolor:green label:"cls_member" -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing" targetname:"data.clientmodule_test.Specialization" arrowstyle:solid backarrowstyle:none textcolor:green label:"relation" -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing2" targetname:"data.clientmodule_test.Specialization" arrowstyle:solid backarrowstyle:none textcolor:green label:"relation2" -} + } } diff --git a/tests/pyreverse/data/classes_colorized.dot b/tests/pyreverse/data/classes_colorized.dot index 4ff12a819..49dc8a7e1 100644 --- a/tests/pyreverse/data/classes_colorized.dot +++ b/tests/pyreverse/data/classes_colorized.dot @@ -7,6 +7,7 @@ charset="utf-8" "data.suppliermodule_test.DoNothing2" [color="aliceblue", fontcolor="black", label=<{DoNothing2|
|}>, shape="record", style="filled"]; "data.suppliermodule_test.DoSomething" [color="aliceblue", fontcolor="black", label=<{DoSomething|my_int : Optional[int]
my_int_2 : Optional[int]
my_string : str
|do_it(new_int: int): int
}>, shape="record", style="filled"]; "data.suppliermodule_test.Interface" [color="aliceblue", fontcolor="black", label=<{Interface|
|get_value()
set_value(value)
}>, shape="record", style="filled"]; +"data.nullable_pattern.NullablePatterns" [color="aliceblue", fontcolor="black", label=<{NullablePatterns|
|return_nullable_1(): int \| None
return_nullable_2(): Optional[int]
}>, shape="record", style="filled"]; "data.property_pattern.PropertyPatterns" [color="aliceblue", fontcolor="black", label=<{PropertyPatterns|prop1
prop2
|}>, shape="record", style="filled"]; "data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label=<{Specialization|TYPE : str
relation
relation2
top : str
|from_value(value: int)
increment_value(): None
transform_value(value: int): int
}>, shape="record", style="filled"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; diff --git a/tests/pyreverse/data/classes_colorized.puml b/tests/pyreverse/data/classes_colorized.puml index 7398ee60f..9c046afa0 100644 --- a/tests/pyreverse/data/classes_colorized.puml +++ b/tests/pyreverse/data/classes_colorized.puml @@ -22,6 +22,10 @@ class "Interface" as data.suppliermodule_test.Interface #aliceblue { {abstract}get_value() {abstract}set_value(value) } +class "NullablePatterns" as data.nullable_pattern.NullablePatterns #aliceblue { + {abstract}return_nullable_1() -> int | None + {abstract}return_nullable_2() -> Optional[int] +} class "PropertyPatterns" as data.property_pattern.PropertyPatterns #aliceblue { prop1 prop2 diff --git a/tests/pyreverse/data/packages_No_Name.dot b/tests/pyreverse/data/packages_No_Name.dot index 5421c328c..61d3eef5c 100644 --- a/tests/pyreverse/data/packages_No_Name.dot +++ b/tests/pyreverse/data/packages_No_Name.dot @@ -3,6 +3,7 @@ rankdir=BT charset="utf-8" "data" [color="black", label=, shape="box", style="solid"]; "data.clientmodule_test" [color="black", label=, shape="box", style="solid"]; +"data.nullable_pattern" [color="black", label=, shape="box", style="solid"]; "data.property_pattern" [color="black", label=, shape="box", style="solid"]; "data.suppliermodule_test" [color="black", label=, shape="box", style="solid"]; "data.clientmodule_test" -> "data.suppliermodule_test" [arrowhead="open", arrowtail="none"]; diff --git a/tests/pyreverse/data/packages_No_Name.html b/tests/pyreverse/data/packages_No_Name.html index 128f8d1a4..3f2b7f3dd 100644 --- a/tests/pyreverse/data/packages_No_Name.html +++ b/tests/pyreverse/data/packages_No_Name.html @@ -8,12 +8,14 @@ } class clientmodule_test { } + class nullable_pattern { + } class property_pattern { } class suppliermodule_test { } clientmodule_test --> suppliermodule_test - + diff --git a/tests/pyreverse/data/packages_No_Name.mmd b/tests/pyreverse/data/packages_No_Name.mmd index e8b02d070..e25fe795e 100644 --- a/tests/pyreverse/data/packages_No_Name.mmd +++ b/tests/pyreverse/data/packages_No_Name.mmd @@ -3,6 +3,8 @@ classDiagram } class clientmodule_test { } + class nullable_pattern { + } class property_pattern { } class suppliermodule_test { diff --git a/tests/pyreverse/data/packages_No_Name.puml b/tests/pyreverse/data/packages_No_Name.puml index 4037b91bd..773b69ff5 100644 --- a/tests/pyreverse/data/packages_No_Name.puml +++ b/tests/pyreverse/data/packages_No_Name.puml @@ -1,16 +1,14 @@ @startuml packages_No_Name set namespaceSeparator none package "data" as data { - } package "data.clientmodule_test" as data.clientmodule_test { - +} +package "data.nullable_pattern" as data.nullable_pattern { } package "data.property_pattern" as data.property_pattern { - } package "data.suppliermodule_test" as data.suppliermodule_test { - } data.clientmodule_test --> data.suppliermodule_test @enduml diff --git a/tests/pyreverse/data/packages_No_Name.vcg b/tests/pyreverse/data/packages_No_Name.vcg index f9f4e4cec..260c46f5b 100644 --- a/tests/pyreverse/data/packages_No_Name.vcg +++ b/tests/pyreverse/data/packages_No_Name.vcg @@ -6,18 +6,21 @@ graph:{ manhattan_edges:yes node: {title:"data" label:"\fbdata\fn" shape:box -} + } node: {title:"data.clientmodule_test" label:"\fbdata.clientmodule_test\fn" shape:box -} + } + node: {title:"data.nullable_pattern" label:"\fbdata.nullable_pattern\fn" + shape:box + } node: {title:"data.property_pattern" label:"\fbdata.property_pattern\fn" shape:box -} + } node: {title:"data.suppliermodule_test" label:"\fbdata.suppliermodule_test\fn" shape:box -} + } edge: {sourcename:"data.clientmodule_test" targetname:"data.suppliermodule_test" arrowstyle:solid backarrowstyle:none backarrowsize:0 -} + } } diff --git a/tests/pyreverse/data/packages_colorized.dot b/tests/pyreverse/data/packages_colorized.dot index 10005f26c..eacc932b1 100644 --- a/tests/pyreverse/data/packages_colorized.dot +++ b/tests/pyreverse/data/packages_colorized.dot @@ -3,6 +3,7 @@ rankdir=BT charset="utf-8" "data" [color="aliceblue", label=, shape="box", style="filled"]; "data.clientmodule_test" [color="aliceblue", label=, shape="box", style="filled"]; +"data.nullable_pattern" [color="aliceblue", label=, shape="box", style="filled"]; "data.property_pattern" [color="aliceblue", label=, shape="box", style="filled"]; "data.suppliermodule_test" [color="aliceblue", label=, shape="box", style="filled"]; "data.clientmodule_test" -> "data.suppliermodule_test" [arrowhead="open", arrowtail="none"]; diff --git a/tests/pyreverse/data/packages_colorized.puml b/tests/pyreverse/data/packages_colorized.puml index 353ae8c47..1066a9448 100644 --- a/tests/pyreverse/data/packages_colorized.puml +++ b/tests/pyreverse/data/packages_colorized.puml @@ -5,6 +5,9 @@ package "data" as data #aliceblue { } package "data.clientmodule_test" as data.clientmodule_test #aliceblue { +} +package "data.nullable_pattern" as data.nullable_pattern #aliceblue { + } package "data.property_pattern" as data.property_pattern #aliceblue { diff --git a/tests/pyreverse/test_diadefs.py b/tests/pyreverse/test_diadefs.py index da16eea33..96cafc2ef 100644 --- a/tests/pyreverse/test_diadefs.py +++ b/tests/pyreverse/test_diadefs.py @@ -141,6 +141,7 @@ def test_known_values1(HANDLER: DiadefsHandler, PROJECT: Project) -> None: assert modules == [ (True, "data"), (True, "data.clientmodule_test"), + (True, "data.nullable_pattern"), (True, "data.property_pattern"), (True, "data.suppliermodule_test"), ] @@ -154,6 +155,7 @@ def test_known_values1(HANDLER: DiadefsHandler, PROJECT: Project) -> None: (True, "DoNothing2"), (True, "DoSomething"), (True, "Interface"), + (True, "NullablePatterns"), (True, "PropertyPatterns"), (True, "Specialization"), ] diff --git a/tests/pyreverse/test_inspector.py b/tests/pyreverse/test_inspector.py index 00cad918f..54fff0896 100644 --- a/tests/pyreverse/test_inspector.py +++ b/tests/pyreverse/test_inspector.py @@ -136,6 +136,7 @@ def test_project_node(project: Project) -> None: expected = [ "data", "data.clientmodule_test", + "data.nullable_pattern", "data.property_pattern", "data.suppliermodule_test", ] -- cgit v1.2.1 From 0b5defa5cfa4662d76cb01c90893c38428e3513c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:27:59 +0000 Subject: [tomlkit] Limit the maximum version of tomlkit (#8633) (#8635) (cherry picked from commit a59f3d588a72ec4e5702f988064dd62bb408ccb8) Co-authored-by: Pierre Sassoulas --- doc/whatsnew/fragments/8632.bugfix | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 doc/whatsnew/fragments/8632.bugfix diff --git a/doc/whatsnew/fragments/8632.bugfix b/doc/whatsnew/fragments/8632.bugfix new file mode 100644 index 000000000..25619d412 --- /dev/null +++ b/doc/whatsnew/fragments/8632.bugfix @@ -0,0 +1,4 @@ +tomlkit max version was set to 0.11.7 following a +regression in tomlkit 0.11.8. + +Closes #8632 diff --git a/pyproject.toml b/pyproject.toml index bd542646b..17b7a68a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", - "tomlkit>=0.10.1", + "tomlkit>=0.10.1,<=0.11.7", "colorama>=0.4.5;sys_platform=='win32'", "typing-extensions>=3.10.0;python_version<'3.10'", ] -- cgit v1.2.1 From fd60b7284a78e3fe371dd90566f0cc316deaf4c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Apr 2023 15:52:35 +0000 Subject: Make sure a ``tool`` table is created in ``toml`` generation (#8638) (#8640) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Sassoulas (cherry picked from commit 434d49f69a65adf75c86dd9629ffbb6d8300df67) Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> --- doc/exts/pylint_options.py | 4 +++- doc/user_guide/configuration/all-options.rst | 6 +++--- doc/whatsnew/fragments/8632.bugfix | 4 ---- pylint/config/arguments_manager.py | 5 ++++- pyproject.toml | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 doc/whatsnew/fragments/8632.bugfix diff --git a/doc/exts/pylint_options.py b/doc/exts/pylint_options.py index f402125a7..2e6be23e2 100644 --- a/doc/exts/pylint_options.py +++ b/doc/exts/pylint_options.py @@ -70,8 +70,10 @@ def _create_checker_section( checker_string += get_rst_title(f"``{checker.capitalize()}`` **Checker**", "-") toml_doc = tomlkit.document() + tool_table = tomlkit.table(is_super_table=True) + toml_doc.add(tomlkit.key("tool"), tool_table) pylint_tool_table = tomlkit.table(is_super_table=True) - toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table) + tool_table.add(tomlkit.key("pylint"), pylint_tool_table) checker_table = tomlkit.table() diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index 2cbc3f483..ecdfc9ef5 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -171,7 +171,7 @@ Standard Checkers """""""""""" *Minimum Python version to use for version dependent checks. Will default to the version used to run pylint.* -**Default:** ``(3, 10)`` +**Default:** ``(3, 11)`` --recursive @@ -233,7 +233,7 @@ Standard Checkers confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"] - disable = ["consider-using-augmented-assign"] + disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "consider-using-augmented-assign"] enable = [] @@ -271,7 +271,7 @@ Standard Checkers persistent = true - py-version = [3, 10] + py-version = [3, 11] recursive = false diff --git a/doc/whatsnew/fragments/8632.bugfix b/doc/whatsnew/fragments/8632.bugfix deleted file mode 100644 index 25619d412..000000000 --- a/doc/whatsnew/fragments/8632.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -tomlkit max version was set to 0.11.7 following a -regression in tomlkit 0.11.8. - -Closes #8632 diff --git a/pylint/config/arguments_manager.py b/pylint/config/arguments_manager.py index 2151aefde..ef1d0cc72 100644 --- a/pylint/config/arguments_manager.py +++ b/pylint/config/arguments_manager.py @@ -704,8 +704,11 @@ class _ArgumentsManager: stdout. """ toml_doc = tomlkit.document() + tool_table = tomlkit.table(is_super_table=True) + toml_doc.add(tomlkit.key("tool"), tool_table) + pylint_tool_table = tomlkit.table(is_super_table=True) - toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table) + tool_table.add(tomlkit.key("pylint"), pylint_tool_table) for group in sorted( self._arg_parser._action_groups, diff --git a/pyproject.toml b/pyproject.toml index 17b7a68a4..bd542646b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", - "tomlkit>=0.10.1,<=0.11.7", + "tomlkit>=0.10.1", "colorama>=0.4.5;sys_platform=='win32'", "typing-extensions>=3.10.0;python_version<'3.10'", ] -- cgit v1.2.1 From 62083dc1f197712e440128620541e5c068d9ccf7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 5 May 2023 16:41:38 +0200 Subject: [changelog] Add a changelog entry for #8632 --- doc/whatsnew/fragments/8632.bugfix | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/whatsnew/fragments/8632.bugfix diff --git a/doc/whatsnew/fragments/8632.bugfix b/doc/whatsnew/fragments/8632.bugfix new file mode 100644 index 000000000..c6f9c01bf --- /dev/null +++ b/doc/whatsnew/fragments/8632.bugfix @@ -0,0 +1,4 @@ +Fixed a crash when generating a configuration file: ``tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key`` +caused by tomlkit ``v0.11.8``. + +Closes #8632 -- cgit v1.2.1 From fc34a4b6abe56f3ac07ca15d846b1c1955545f85 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 5 May 2023 18:30:34 +0200 Subject: Bump pylint to 2.17.4, update changelog Co-authored-by: Jacob Walls --- doc/whatsnew/2/2.17/index.rst | 31 ++++++++++++++++++++++++++++++ doc/whatsnew/fragments/8603.bugfix | 3 --- doc/whatsnew/fragments/8613.false_positive | 3 --- doc/whatsnew/fragments/8632.bugfix | 4 ---- pylint/__pkginfo__.py | 2 +- tbump.toml | 2 +- towncrier.toml | 2 +- 7 files changed, 34 insertions(+), 13 deletions(-) delete mode 100644 doc/whatsnew/fragments/8603.bugfix delete mode 100644 doc/whatsnew/fragments/8613.false_positive delete mode 100644 doc/whatsnew/fragments/8632.bugfix diff --git a/doc/whatsnew/2/2.17/index.rst b/doc/whatsnew/2/2.17/index.rst index 974ebb501..cd14488b7 100644 --- a/doc/whatsnew/2/2.17/index.rst +++ b/doc/whatsnew/2/2.17/index.rst @@ -29,6 +29,37 @@ so we find problems before the actual release. .. towncrier release notes start +What's new in Pylint 2.17.4? +---------------------------- +Release date: 2023-05-06 + + +False Positives Fixed +--------------------- + +- Fix a false positive for ``bad-dunder-name`` when there is a user-defined + ``__index__`` method. + + Closes #8613 (`#8613 `_) + + + +Other Bug Fixes +--------------- + +- ``pyreverse``: added escaping of vertical bar character in annotation labels + produced by DOT printer to ensure it is not treated as field separator of + record-based nodes. + + Closes #8603 (`#8603 `_) + +- Fixed a crash when generating a configuration file: + ``tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key`` + caused by tomlkit ``v0.11.8``. + + Closes #8632 (`#8632 `_) + + What's new in Pylint 2.17.3? ---------------------------- Release date: 2023-04-24 diff --git a/doc/whatsnew/fragments/8603.bugfix b/doc/whatsnew/fragments/8603.bugfix deleted file mode 100644 index 1a1025c4b..000000000 --- a/doc/whatsnew/fragments/8603.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -``pyreverse``: added escaping of vertical bar character in annotation labels produced by DOT printer to ensure it is not treated as field separator of record-based nodes. - -Closes #8603 diff --git a/doc/whatsnew/fragments/8613.false_positive b/doc/whatsnew/fragments/8613.false_positive deleted file mode 100644 index 80d28e9c2..000000000 --- a/doc/whatsnew/fragments/8613.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix a false positive for ``bad-dunder-name`` when there is a user-defined ``__index__`` method. - -Closes #8613 diff --git a/doc/whatsnew/fragments/8632.bugfix b/doc/whatsnew/fragments/8632.bugfix deleted file mode 100644 index c6f9c01bf..000000000 --- a/doc/whatsnew/fragments/8632.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -Fixed a crash when generating a configuration file: ``tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key`` -caused by tomlkit ``v0.11.8``. - -Closes #8632 diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index a140a9791..3566c348f 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ It's updated via tbump, do not modify. from __future__ import annotations -__version__ = "2.17.3" +__version__ = "2.17.4" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index 62cfd5498..d1d78074c 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/PyCQA/pylint" [version] -current = "2.17.3" +current = "2.17.4" regex = ''' ^(?P0|[1-9]\d*) \. diff --git a/towncrier.toml b/towncrier.toml index fce326ad6..d8ef40f10 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] -version = "2.17.3" +version = "2.17.4" directory = "doc/whatsnew/fragments" filename = "doc/whatsnew/2/2.17/index.rst" template = "doc/whatsnew/fragments/_template.rst" -- cgit v1.2.1