Skip to content

Commit 0e6b01b

Browse files
committed
Bump ruff to 0.2.0
1 parent 29a3682 commit 0e6b01b

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

.pre-commit-config.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pylint, pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.1.6
22+
rev: v0.2.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -31,10 +31,8 @@ repos:
3131
exclude: ^pandas/tests
3232
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
3333
- id: ruff-format
34-
# TODO: "." not needed in ruff 0.1.8
35-
args: ["."]
3634
- repo: https://github.com/jendrikseipp/vulture
37-
rev: 'v2.10'
35+
rev: v2.11
3836
hooks:
3937
- id: vulture
4038
entry: python scripts/run_vulture.py

pandas/core/apply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ def normalize_keyword_aggregation(
17981798

17991799

18001800
def _make_unique_kwarg_list(
1801-
seq: Sequence[tuple[Any, Any]]
1801+
seq: Sequence[tuple[Any, Any]],
18021802
) -> Sequence[tuple[Any, Any]]:
18031803
"""
18041804
Uniquify aggfunc name of the pairs in the order list

pandas/io/parsers/c_parser_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def _concatenate_chunks(chunks: list[dict[int, ArrayLike]]) -> dict:
390390

391391

392392
def ensure_dtype_objs(
393-
dtype: DtypeArg | dict[Hashable, DtypeArg] | None
393+
dtype: DtypeArg | dict[Hashable, DtypeArg] | None,
394394
) -> DtypeObj | dict[Hashable, DtypeObj] | None:
395395
"""
396396
Ensure we have either None, a dtype object, or a dictionary mapping to

pandas/plotting/_matplotlib/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def _validate_color_args(self, color, colormap):
465465
@final
466466
@staticmethod
467467
def _iter_data(
468-
data: DataFrame | dict[Hashable, Series | DataFrame]
468+
data: DataFrame | dict[Hashable, Series | DataFrame],
469469
) -> Iterator[tuple[Hashable, np.ndarray]]:
470470
for col, values in data.items():
471471
# This was originally written to use values.values before EAs

pandas/plotting/_matplotlib/tools.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,15 @@ def _get_layout(
9898
nrows, ncols = layout
9999

100100
if nrows == -1 and ncols > 0:
101-
layout = nrows, ncols = (ceil(nplots / ncols), ncols)
101+
layout = (ceil(nplots / ncols), ncols)
102102
elif ncols == -1 and nrows > 0:
103-
layout = nrows, ncols = (nrows, ceil(nplots / nrows))
103+
layout = (nrows, ceil(nplots / nrows))
104104
elif ncols <= 0 and nrows <= 0:
105105
msg = "At least one dimension of layout must be positive"
106106
raise ValueError(msg)
107107

108+
nrows, ncols = layout
109+
108110
if nrows * ncols < nplots:
109111
raise ValueError(
110112
f"Layout of {nrows}x{ncols} must be larger than required size {nplots}"

pandas/tests/indexes/multi/test_join.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_join_dtypes_all_nan(any_numeric_ea_dtype):
260260

261261
def test_join_index_levels():
262262
# GH#53093
263-
midx = midx = MultiIndex.from_tuples([("a", "2019-02-01"), ("a", "2019-02-01")])
263+
midx = MultiIndex.from_tuples([("a", "2019-02-01"), ("a", "2019-02-01")])
264264
midx2 = MultiIndex.from_tuples([("a", "2019-01-31")])
265265
result = midx.join(midx2, how="outer")
266266
expected = MultiIndex.from_tuples(

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ environment = {CFLAGS="-g0"}
191191
line-length = 88
192192
target-version = "py310"
193193
fix = true
194+
195+
[tool.ruff.lint]
194196
unfixable = []
195197
typing-modules = ["pandas._typing"]
196198

@@ -294,7 +296,7 @@ ignore = [
294296
# Use `typing.NamedTuple` instead of `collections.namedtuple`
295297
"PYI024",
296298
# No builtin `eval()` allowed
297-
"PGH001",
299+
# "S307", # flake8-bandit is not enabled yet
298300
# compare-to-empty-string
299301
"PLC1901",
300302
# while int | float can be shortened to float, the former is more explicit
@@ -337,7 +339,7 @@ ignore = [
337339
# pairwise-over-zipped (>=PY310 only)
338340
"RUF007",
339341
# mutable-class-default
340-
"RUF012"
342+
"RUF012",
341343
]
342344

343345
exclude = [
@@ -352,7 +354,7 @@ exclude = [
352354
"env",
353355
]
354356

355-
[tool.ruff.per-file-ignores]
357+
[tool.ruff.lint.per-file-ignores]
356358
# relative imports allowed for asv_bench
357359
"asv_bench/*" = ["TID", "NPY002"]
358360
# to be enabled gradually

scripts/validate_min_versions_in_sync.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_operator_from(dependency: str) -> str | None:
105105

106106

107107
def get_yaml_map_from(
108-
yaml_dic: list[str | dict[str, list[str]]]
108+
yaml_dic: list[str | dict[str, list[str]]],
109109
) -> dict[str, list[str] | None]:
110110
yaml_map: dict[str, list[str] | None] = {}
111111
for dependency in yaml_dic:

0 commit comments

Comments
 (0)