Skip to content

Commit

Permalink
Migrate ruff config to the latest format (#57791)
Browse files Browse the repository at this point in the history
* Migrate ruff config to the latest format

* Fix errors discovered by the new config
  • Loading branch information
tqa236 authored Mar 9, 2024
1 parent 77f9d7a commit dc19148
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/sphinxext/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$ ./scripts/announce.py $GITHUB v1.11.0..v1.11.1 > announce.rst
"""

import codecs
import os
import re
Expand Down
1 change: 1 addition & 0 deletions doc/sphinxext/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
While the v0.23.1 tag does not exist, that will use the HEAD of the
branch as the end of the revision range.
"""

from announce import build_components
from docutils import nodes
from docutils.parsers.rst import Directive
Expand Down
2 changes: 1 addition & 1 deletion pandas/util/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class InvalidVersion(ValueError):
Examples
--------
>>> pd.util.version.Version('1.')
>>> pd.util.version.Version("1.")
Traceback (most recent call last):
InvalidVersion: Invalid version: '1.'
"""
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ environment = {CFLAGS="-g0"}
line-length = 88
target-version = "py310"
fix = true

[tool.ruff.lint]
unfixable = []
typing-modules = ["pandas._typing"]

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

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# relative imports allowed for asv_bench
"asv_bench/*" = ["TID", "NPY002"]
# to be enabled gradually
Expand Down

0 comments on commit dc19148

Please sign in to comment.