Skip to content

Commit 9c4d989

Browse files
tqa236pmhatre1
authored andcommitted
Migrate ruff config to the latest format (pandas-dev#57791)
* Migrate ruff config to the latest format * Fix errors discovered by the new config
1 parent 4f3cd55 commit 9c4d989

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

doc/sphinxext/announce.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
$ ./scripts/announce.py $GITHUB v1.11.0..v1.11.1 > announce.rst
3333
3434
"""
35+
3536
import codecs
3637
import os
3738
import re

doc/sphinxext/contributors.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
While the v0.23.1 tag does not exist, that will use the HEAD of the
1515
branch as the end of the revision range.
1616
"""
17+
1718
from announce import build_components
1819
from docutils import nodes
1920
from docutils.parsers.rst import Directive

pandas/util/version/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class InvalidVersion(ValueError):
131131
132132
Examples
133133
--------
134-
>>> pd.util.version.Version('1.')
134+
>>> pd.util.version.Version("1.")
135135
Traceback (most recent call last):
136136
InvalidVersion: Invalid version: '1.'
137137
"""

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ environment = {CFLAGS="-g0"}
185185
line-length = 88
186186
target-version = "py310"
187187
fix = true
188+
189+
[tool.ruff.lint]
188190
unfixable = []
189191
typing-modules = ["pandas._typing"]
190192

@@ -271,8 +273,8 @@ ignore = [
271273
"PLW0603",
272274
# Use `typing.NamedTuple` instead of `collections.namedtuple`
273275
"PYI024",
274-
# No builtin `eval()` allowed
275-
"PGH001",
276+
# Use of possibly insecure function; consider using ast.literal_eval
277+
"S307",
276278
# while int | float can be shortened to float, the former is more explicit
277279
"PYI041",
278280
# incorrect-dict-iterator, flags valid Series.items usage
@@ -345,7 +347,7 @@ exclude = [
345347
[tool.ruff.lint.flake8-import-conventions.aliases]
346348
"pandas.core.construction.array" = "pd_array"
347349

348-
[tool.ruff.per-file-ignores]
350+
[tool.ruff.lint.per-file-ignores]
349351
# relative imports allowed for asv_bench
350352
"asv_bench/*" = ["TID", "NPY002"]
351353
# to be enabled gradually

0 commit comments

Comments
 (0)