Skip to content

Commit 39425dc

Browse files
committed
refactor(ruff): TRY, PT, BLE
1 parent b1b2007 commit 39425dc

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ fix = true
178178
[tool.ruff.lint]
179179
extend-select = ["ALL"]
180180
ignore = [
181-
# The following rules are ignored permanently for good reasons
182181
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
183182
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
184183
"E501", # handled by black https://docs.astral.sh/ruff/rules/line-too-long/
@@ -203,11 +202,8 @@ ignore = [
203202
"ERA001", "ANN001", "ANN201", "ANN202", "ANN204", "ANN206", "ANN401", "PLR0402", "PLC0105"
204203
]
205204
"scripts/*" = [
206-
# The following rules are ignored permanently for good reasons
207205
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
208206
"S603", # https://docs.astral.sh/ruff/rules/subprocess-without-shell-equals-true/
209-
# The following rules are ignored temporarily. Either fix them or move to the permanent list above.
210-
"TRY", "PT", "BLE"
211207
]
212208
"tests/*" = [
213209
# The following rules are ignored permanently for good reasons

scripts/_job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __rollback_job(steps: deque[Step]) -> None:
2525
logger.warning(f"Undoing: {step.name}")
2626
try:
2727
step.rollback()
28-
except Exception:
28+
except Exception: # noqa: BLE001
2929
logger.error(
3030
f"Rollback of Step: '{step.name}' failed! The project could be in a unstable mode."
3131
)
@@ -47,7 +47,7 @@ def run_job(steps: list[Step]) -> None:
4747
rollback_steps.append(step)
4848
step.run()
4949

50-
except Exception:
50+
except Exception: # noqa: BLE001
5151
logger.error(f"Step: '{step.name}' failed!")
5252
__rollback_job(rollback_steps)
5353
failed = True

scripts/test/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
def test(
25-
src: bool = False,
26-
dist: bool = False,
27-
type_checker: Literal["", "mypy", "pyright"] = "",
25+
src: bool = False, # noqa: PT028
26+
dist: bool = False, # noqa: PT028
27+
type_checker: Literal["", "mypy", "pyright"] = "", # noqa: PT028
2828
) -> None:
2929
steps = []
3030
if src:

scripts/test/run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def rename_src() -> None:
6262
if Path(r"pandas-stubs").exists():
6363
Path(r"pandas-stubs").rename("_pandas-stubs")
6464
else:
65-
raise FileNotFoundError("'pandas-stubs' folder does not exists.")
65+
raise FileNotFoundError( # noqa: TRY003
66+
"'pandas-stubs' folder does not exists."
67+
)
6668

6769

6870
def mypy_dist() -> None:
@@ -84,7 +86,9 @@ def restore_src() -> None:
8486
if Path(r"_pandas-stubs").exists():
8587
Path(r"_pandas-stubs").rename("pandas-stubs")
8688
else:
87-
raise FileNotFoundError("'_pandas-stubs' folder does not exists.")
89+
raise FileNotFoundError( # noqa: TRY003
90+
"'_pandas-stubs' folder does not exists."
91+
)
8892

8993

9094
def nightly_pandas() -> None:

0 commit comments

Comments
 (0)