Skip to content

Commit 1195f5c

Browse files
stdedosAnis Da Silva Campos
authored and
Anis Da Silva Campos
committed
use pylint v3 in the repo
Fix `pylint` configuration for v3 https://pylint.pycqa.org/en/latest/whatsnew/3/3.0/index.html#changes-requiring-user-actions Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
1 parent c8bbaeb commit 1195f5c

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

pylint_pytest/checkers/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ class BasePytestChecker(BaseChecker):
88
# todo(maybe-remove): if we only support pylint>=3
99
# Since https://github.com/pylint-dev/pylint/pull/8404, pylint does not need this
1010
# __implements__ pattern. keeping it for retro compatibility with pylint==2.x
11-
from pylint.interfaces import IAstroidChecker # pylint: disable=import-outside-toplevel
11+
# pylint: disable=import-outside-toplevel,no-name-in-module
12+
from pylint.interfaces import IAstroidChecker
1213

1314
__implements__ = IAstroidChecker
1415

pylint_pytest/checkers/fixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def visit_functiondef(self, node):
232232
for arg in node.args.args:
233233
self._invoked_with_func_args.add(arg.name)
234234

235-
# pylint: disable=bad-staticmethod-argument,too-many-branches # The function itself is an if-return logic.
235+
# pylint: disable=bad-staticmethod-argument # The function itself is an if-return logic.
236236
@staticmethod
237237
def patch_add_message(
238238
self, msgid, line=None, node=None, args=None, confidence=None, col_offset=None

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,11 @@ load-plugins= [
123123
"pylint.extensions.broad_try_clause",
124124
"pylint.extensions.check_elif",
125125
"pylint.extensions.code_style",
126-
"pylint.extensions.comparetozero",
127126
"pylint.extensions.comparison_placement",
128127
"pylint.extensions.confusing_elif",
129128
# "pylint.extensions.consider_ternary_expression", # Not a pretty refactoring
130129
"pylint.extensions.docparams",
131130
"pylint.extensions.docstyle",
132-
"pylint.extensions.emptystring",
133131
"pylint.extensions.eq_without_hash",
134132
"pylint.extensions.for_any_all",
135133
"pylint.extensions.mccabe",
@@ -174,4 +172,8 @@ output-format = "colorized"
174172
ignored-argument-names = "_.*"
175173

176174
[tool.pylint."messages control"]
177-
enable = ["useless-suppression"]
175+
enable = [
176+
"useless-suppression",
177+
"use-implicit-booleaness-not-comparison-to-zero",
178+
"use-implicit-booleaness-not-comparison-to-string",
179+
]

tests/base_tester.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from abc import ABC
44
from pathlib import Path
55
from pprint import pprint
6-
from typing import Any, Dict, List
6+
from typing import List, Type
77

88
import astroid
99
from pylint.checkers import BaseChecker
@@ -23,10 +23,9 @@ def get_test_root_path() -> Path:
2323

2424
class BasePytestTester(ABC):
2525
CHECKER_CLASS = BaseChecker
26-
IMPACTED_CHECKER_CLASSES: List[BaseChecker] = []
26+
IMPACTED_CHECKER_CLASSES: List[Type[BaseChecker]] = []
2727
MSG_ID: str
2828
msgs: List[MessageTest] = []
29-
CONFIG: Dict[str, Any] = {}
3029

3130
def __init_subclass__(cls, **kwargs):
3231
super().__init_subclass__(**kwargs)
@@ -72,14 +71,10 @@ def setup_method(self):
7271
self.checker = self.CHECKER_CLASS(self.linter)
7372
self.impacted_checkers = []
7473

75-
for key, value in self.CONFIG.items():
76-
setattr(self.checker.config, key, value)
7774
self.checker.open()
7875

7976
for checker_class in self.IMPACTED_CHECKER_CLASSES:
8077
checker = checker_class(self.linter)
81-
for key, value in self.CONFIG.items():
82-
setattr(checker.config, key, value)
8378
checker.open()
8479
self.impacted_checkers.append(checker)
8580

0 commit comments

Comments
 (0)