Skip to content

Commit bae4eb3

Browse files
authored
Improve some linter and formatter rules. (#524)
1 parent f509634 commit bae4eb3

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1515
{func}`~pytask.task`. Closes {issue}`512`.
1616
- {pull}`522` improves the issue templates.
1717
- {pull}`523` refactors `_pytask.console._get_file`.
18+
- {pull}`524` improves some linting and formatter rules.
1819

1920
## 0.4.4 - 2023-12-04
2021

pyproject.toml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,20 @@ target-version = "py38"
106106
select = ["ALL"]
107107
fix = true
108108
ignore = [
109+
"FBT", # flake8-boolean-trap
109110
"I", # ignore isort
110111
"TRY", # ignore tryceratops.
111112
# Others.
112-
"ISC001",
113-
"S101", # raise errors for asserts.
114113
"ANN101", # type annotating self
115114
"ANN102", # type annotating cls
116-
"FBT", # flake8-boolean-trap
117115
"ANN401", # flake8-annotate typing.Any
118-
"PD", # pandas-vet
119-
"COM812", # trailing comma missing, but black takes care of that
120-
"D401", # imperative mood for first line. too many false-positives.
116+
"COM812", # Comply with ruff-format.
117+
"ISC001", # Comply with ruff-format.
118+
"PD901", # Avoid generic df for dataframes.
119+
"S101", # raise errors for asserts.
120+
"S603", # Call check with subprocess.run.
121+
"S607", # Call subprocess.run with partial executable path.
121122
"SLF001", # access private members.
122-
"S603",
123-
"S607",
124123
]
125124

126125

@@ -131,7 +130,7 @@ ignore = [
131130
"src/_pytask/outcomes.py" = ["N818"]
132131
"src/_pytask/dag.py" = ["B023"]
133132
"tests/test_capture.py" = ["T201", "PT011"]
134-
"tests/*" = ["D", "ANN", "PLR2004", "S101"]
133+
"tests/*" = ["ANN", "D", "FBT", "PLR2004", "S101"]
135134
"tests/test_jupyter/*" = ["INP001"]
136135
"scripts/*" = ["D", "INP001"]
137136
"docs/source/conf.py" = ["D401", "INP001"]
@@ -185,7 +184,7 @@ module = ["_pytask.hookspecs"]
185184
disable_error_code = ["empty-body"]
186185

187186
[tool.codespell]
188-
ignore-words-list = "falsy, hist, ines, unparseable"
187+
skip = "*.js,*/termynal.css"
189188

190189
[tool.refurb]
191190
python_version = "3.8"

src/_pytask/debugging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class PdbTrace:
374374
def pytask_execute_task(
375375
session: Session, task: PTask
376376
) -> Generator[None, None, None]:
377-
"""Wrapping the task function with a tracer."""
377+
"""Wrap the task function with a tracer."""
378378
if isinstance(task, PTask):
379379
wrap_function_for_tracing(session, task)
380380
yield

src/_pytask/hookspecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def pytask_collect_task_protocol(
174174
def pytask_collect_task_setup(
175175
session: Session, path: Path | None, name: str, obj: Any
176176
) -> None:
177-
"""Steps before collecting a task."""
177+
"""Set up collecting a task."""
178178

179179

180180
@hookspec(firstresult=True)

src/_pytask/skipping.py

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

2323

2424
def skip_ancestor_failed(reason: str = "No reason provided.") -> str:
25-
"""Function to parse information in ``@pytask.mark.skip_ancestor_failed``."""
25+
"""Parse information in ``@pytask.mark.skip_ancestor_failed``."""
2626
return reason
2727

2828

2929
def skipif(condition: bool, *, reason: str) -> tuple[bool, str]:
30-
"""Function to parse information in ``@pytask.mark.skipif``."""
30+
"""Parse information in ``@pytask.mark.skipif``."""
3131
return condition, reason
3232

3333

src/_pytask/traceback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _is_internal_or_hidden_traceback_frame(
131131
_PYTASK_DIRECTORY,
132132
),
133133
) -> bool:
134-
"""Returns ``True`` if traceback frame belongs to internal packages or is hidden.
134+
"""Return ``True`` if traceback frame belongs to internal packages or is hidden.
135135
136136
Internal packages are ``_pytask`` and ``pluggy``. A hidden frame is indicated by a
137137
local variable called ``__tracebackhide__ = True``.

0 commit comments

Comments
 (0)