Skip to content

STYLE: Detect unnecessary pylint ignore #57918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ repos:
hooks:
- id: pylint
stages: [manual]
args: [--load-plugins=pylint.extensions.redefined_loop_name]
args: [--load-plugins=pylint.extensions.redefined_loop_name, --fail-on=I0021]
- id: pylint
alias: redefined-outer-name
name: Redefining name from outer scope
Expand Down
1 change: 0 additions & 1 deletion pandas/core/groupby/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def _positional_selector(self) -> GroupByPositionalSelector:
4 b 5
"""
if TYPE_CHECKING:
# pylint: disable-next=used-before-assignment
groupby_self = cast(groupby.GroupBy, self)
else:
groupby_self = self
Expand Down
1 change: 0 additions & 1 deletion pandas/core/tools/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,6 @@ def to_datetime(
errors=errors,
exact=exact,
)
# pylint: disable-next=used-before-assignment
result: Timestamp | NaTType | Series | Index

if isinstance(arg, Timestamp):
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/io/formats/test_to_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,6 @@ def test_to_latex_multiindex_names(self, name0, name1, axes):
)
col_names = [n if (bool(n) and 1 in axes) else "" for n in names]
observed = df.to_latex(multirow=False)
# pylint: disable-next=consider-using-f-string
expected = r"""\begin{tabular}{llrrrr}
\toprule
& %s & \multicolumn{2}{r}{1} & \multicolumn{2}{r}{2} \\
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/series/test_iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ def test_keys(self, datetime_series):

def test_iter_datetimes(self, datetime_series):
for i, val in enumerate(datetime_series):
# pylint: disable-next=unnecessary-list-index-lookup
assert val == datetime_series.iloc[i]

def test_iter_strings(self, string_series):
for i, val in enumerate(string_series):
# pylint: disable-next=unnecessary-list-index-lookup
assert val == string_series.iloc[i]

def test_iteritems_datetimes(self, datetime_series):
Expand Down