Skip to content

Commit ee906ec

Browse files
committed
Ignore PLC0415 ruff rule
1 parent ed51b79 commit ee906ec

2 files changed

Lines changed: 27 additions & 25 deletions

File tree

cicd_utils/cicd/test_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from importlib.util import module_from_spec, spec_from_file_location
77
from pathlib import Path
88
from typing import TYPE_CHECKING, Any, TypeVar, cast
9+
from unittest.mock import MagicMock, patch
910

1011
if TYPE_CHECKING:
1112
from collections.abc import Iterator
@@ -22,8 +23,6 @@ def patch_plotly_show() -> Iterator[None]:
2223
and, instead, simply call
2324
:func:`plotly.io._utils.validate_coerce_fig_to_dict()`.
2425
"""
25-
from unittest.mock import MagicMock, patch
26-
2726
from plotly.io._utils import validate_coerce_fig_to_dict
2827

2928
def patched(

ruff.toml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,29 @@ ignore = [
2222
"FBT", # flake8-boolean-trap
2323
"FIX", # flake8-fixme
2424

25-
# flake8-comprehensions
25+
# flake8-commas (COM)
26+
"COM812", # Trailing comma missing
27+
28+
# flake8-comprehensions (C4)
2629
"C408", # Unnecessary `dict` call (rewrite as a literal)
2730

28-
# pydocstyle
31+
# flake8-errmsg (EM)
32+
"EM101", # Exception must not use a string literal, assign to variable first
33+
"EM102", # Exception must not use an f-string literal, assign to variable first
34+
"EM103", # Exception must not use a .format() string directly, assign to variable first
35+
36+
# flake8-return (RET)
37+
"RET504", # Unnecessary variable assignment before `return` statement
38+
39+
# flake8-todos (TD)
40+
"TD001", # Invalid TODO tag: `FIXME`
41+
"TD002", # Missing author in [...]
42+
"TD003", # Missing issue link on the line following this TODO
43+
44+
# flake8-annotations (ANN)
45+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
46+
47+
# pydocstyle (D)
2948
"D101", # Missing docstring in public class
3049
"D102", # Missing docstring in public method
3150
"D103", # Missing docstring in public function
@@ -36,43 +55,27 @@ ignore = [
3655
"D400", # First line should end with a period
3756
"D415", # First line should end with a period, question mark, or exclamation point
3857

39-
# flake8-return
40-
"RET504", # Unnecessary variable assignment before `return` statement
41-
4258
# eradicate (ERA)
4359
"ERA001", # Found commented-out code
4460

45-
# pandas-vet
61+
# pandas-vet (PD)
4662
"PD015", # Use `.merge` method instead of `pd.merge` function. They have equivalent functionality.
4763
"PD901", # `df` is a bad variable name. Be kinder to your future self.
4864

49-
# pylint
65+
# Convention (PLC)
66+
"PLC0415", # `import` should be at the top-level of a file
67+
68+
# Refactor (PLR)
5069
"PLR0913", # Too many arguments to function call ({x} > 5)
5170
"PLR2004", # Magic value used in comparison, consider replacing {x} with a constant variable
5271

5372
# tryceratops
5473
"TRY003", # Avoid specifying long messages outside the exception class
5574

56-
# flake8-commas (COM)
57-
"COM812", # Trailing comma missing
58-
59-
# flake8-errmsg (EM)
60-
"EM101", # Exception must not use a string literal, assign to variable first
61-
"EM102", # Exception must not use an f-string literal, assign to variable first
62-
"EM103", # Exception must not use a .format() string directly, assign to variable first
63-
6475
# pep8-naming
6576
# (allow for sklearn's naming convention for uppercase `X`)
6677
"N803", # Argument name should be lowercase
6778
"N806", # Variable in function should be lowercase
68-
69-
# flake8-todos (TD)
70-
"TD001", # Invalid TODO tag: `FIXME`
71-
"TD002", # Missing author in [...]
72-
"TD003", # Missing issue link on the line following this TODO
73-
74-
# flake8-annotations (ANN)
75-
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
7679
]
7780

7881
[lint.per-file-ignores]

0 commit comments

Comments
 (0)