Skip to content

Commit dbb1252

Browse files
[pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965)
1 parent cf5ea8a commit dbb1252

34 files changed

+10
-44
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ repos:
4444
- id: isort
4545
exclude: doc/data/messages/(r/reimported|w/wrong-import-order|u/ungrouped-imports|m/misplaced-future|m/multiple-imports)/bad.py
4646
- repo: https://github.com/psf/black
47-
rev: 22.12.0
47+
rev: 23.1a1
4848
hooks:
4949
- id: black
5050
args: [--safe, --quiet]

examples/custom_raw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def process_module(self, node: nodes.Module) -> None:
3232
the module's content is accessible via node.stream() function
3333
"""
3434
with node.stream() as stream:
35-
for (lineno, line) in enumerate(stream):
35+
for lineno, line in enumerate(stream):
3636
if line.rstrip().endswith("\\"):
3737
self.add_message("backslash-line-continuation", line=lineno)
3838

pylint/checkers/base/basic_error_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def visit_functiondef(self, node: nodes.FunctionDef) -> None:
301301
visit_asyncfunctiondef = visit_functiondef
302302

303303
def _check_name_used_prior_global(self, node: nodes.FunctionDef) -> None:
304-
305304
scope_globals = {
306305
name: child
307306
for child in node.nodes_of_class(nodes.Global)

pylint/checkers/base_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
@functools.total_ordering
3636
class BaseChecker(_ArgumentsProvider):
37-
3837
# checker name (you may reuse an existing one)
3938
name: str = ""
4039
# ordered list of options to control the checker behaviour

pylint/checkers/classes/class_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,6 @@ def _check_unused_private_functions(self, node: nodes.ClassDef) -> None:
975975
"cls",
976976
node.name,
977977
}:
978-
979978
break
980979

981980
# Check type(self).__attrname

pylint/checkers/classes/special_methods_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ def _check_getnewargs_ex(
394394
(inferred.elts[0], self._is_tuple),
395395
(inferred.elts[1], self._is_dict),
396396
):
397-
398397
if isinstance(arg, nodes.Call):
399398
arg = safe_infer(arg)
400399

pylint/checkers/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _get_by_id_managed_msgs(self) -> list[ManagedMessage]:
4242
def process_module(self, node: nodes.Module) -> None:
4343
"""Inspect the source file to find messages activated or deactivated by id."""
4444
managed_msgs = self._get_by_id_managed_msgs()
45-
for (mod_name, msgid, symbol, lineno, is_disabled) in managed_msgs:
45+
for mod_name, msgid, symbol, lineno, is_disabled in managed_msgs:
4646
if mod_name == node.name:
4747
verb = "disable" if is_disabled else "enable"
4848
txt = f"'{msgid}' is cryptic: use '# pylint: {verb}={symbol}' instead"

pylint/checkers/refactoring/recommendation_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
class RecommendationChecker(checkers.BaseChecker):
16-
1716
name = "refactoring"
1817
msgs = {
1918
"C0200": (

pylint/checkers/refactoring/refactoring_checker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@ def _type_and_name_are_equal(node_a: Any, node_b: Any) -> bool:
788788
return False
789789

790790
def _is_dict_get_block(self, node: nodes.If) -> bool:
791-
792791
# "if <compare node>"
793792
if not isinstance(node.test, nodes.Compare):
794793
return False
@@ -1115,7 +1114,6 @@ def _has_exit_in_scope(scope: nodes.LocalsDictNodeNG) -> bool:
11151114
)
11161115

11171116
def _check_quit_exit_call(self, node: nodes.Call) -> None:
1118-
11191117
if isinstance(node.func, nodes.Name) and node.func.name in BUILTIN_EXIT_FUNCS:
11201118
# If we have `exit` imported from `sys` in the current or global scope, exempt this instance.
11211119
local_scope = node.scope()

pylint/checkers/spelling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def process_tokens(self, tokens: list[tokenize.TokenInfo]) -> None:
427427
return
428428

429429
# Process tokens and look for comments.
430-
for (tok_type, token, (start_row, _), _, _) in tokens:
430+
for tok_type, token, (start_row, _), _, _ in tokens:
431431
if tok_type == tokenize.COMMENT:
432432
if start_row == 1 and token.startswith("#!/"):
433433
# Skip shebang lines

0 commit comments

Comments
 (0)