Skip to content

Migrate ruff config to the latest format #57791

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 2 commits into from
Mar 9, 2024
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
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