Skip to content

STY: Enable Ruff specific checks #53510

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 1 commit into from
Jun 3, 2023
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
6 changes: 4 additions & 2 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
)
import warnings

from pandas._typing import F # noqa: TCH001
from pandas._typing import T # noqa: TCH001
from pandas._typing import (
F,
T,
)
from pandas.util._exceptions import find_stack_level


Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Below imports needs to happen first to ensure pandas top level
# module gets monkeypatched with the pandas_datetime_CAPI
# see pandas_datetime_exec in pd_datetime.c
import pandas._libs.pandas_parser # noqa: F401,E501 # isort: skip # type: ignore[reportUnusedImport]
import pandas._libs.pandas_parser # noqa: E501 # isort: skip # type: ignore[reportUnusedImport]
import pandas._libs.pandas_datetime # noqa: F401,E501 # isort: skip # type: ignore[reportUnusedImport]
from pandas._libs.interval import Interval
from pandas._libs.tslibs import (
Expand Down
2 changes: 1 addition & 1 deletion pandas/api/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pandas._libs.lib import infer_dtype

from pandas.core.dtypes.api import * # noqa: F401, F403
from pandas.core.dtypes.api import * # noqa: F403
from pandas.core.dtypes.concat import union_categoricals
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ class ArrowDtype(StorageExtensionDtype):
timestamp[s, tz=America/New_York][pyarrow]
>>> pd.ArrowDtype(pa.list_(pa.int64()))
list<item: int64>[pyarrow]
""" # noqa: E501
"""

_metadata = ("storage", "pyarrow_dtype") # type: ignore[assignment]

Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ select = [
# comprehensions
"C4",
# pygrep-hooks
"PGH"
"PGH",
# Ruff-specific rules
"RUF",
]

ignore = [
Expand Down Expand Up @@ -308,6 +310,18 @@ ignore = [
"PLR2004",
# Consider `elif` instead of `else` then `if` to remove indentation level
"PLR5501",
# ambiguous-unicode-character-string
"RUF001",
# ambiguous-unicode-character-docstring
"RUF002",
# ambiguous-unicode-character-comment
"RUF003",
# collection-literal-concatenation
"RUF005",
# pairwise-over-zipped (>=PY310 only)
"RUF007",
# explicit-f-string-type-conversion
"RUF010"
]

exclude = [
Expand Down