Skip to content

Commit fe681bf

Browse files
committed
Ignore RUF043 and RUF059
1 parent 44e46d3 commit fe681bf

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@ ignore = [
100100
"RUF015",
101101
# Use `X | Y` in `isinstance` (see https://github.com/home-assistant/core/issues/123850)
102102
"UP038",
103+
# Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
104+
"RUF043",
103105
"RUF046", # Value being cast to `int` is already an integer
104106

107+
# TODO: Move this ignore so that it only applies in the tests folder. Do in conjunction with any doc related rules
108+
"RUF059", # Unpacked variable `coords` is never used
109+
105110
# TODO: ignore for now (requires more work). Remove ignore once fixed
106111
# Missing docstring in public module
107112
"D100",
@@ -125,6 +130,19 @@ ignore = [
125130
"D205",
126131
"F811",
127132
]
133+
[tool.ruff.lint.per-file-ignores]
134+
# Ignore docstring rules everywhere except for the stable files (particleset.py).
135+
"!src/parcels/_core/{particleset}.py" = [
136+
# Missing docstring in public module
137+
"RUF059",
138+
# Missing docstring in public class
139+
"D101",
140+
# Missing docstring in public method
141+
"D102",
142+
# Missing docstring in public function
143+
"D103",
144+
]
145+
128146

129147
[tool.ruff.lint.pydocstyle]
130148
convention = "numpy"

tests/utils/test_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def test_time_interval_intersection_different_calendars():
179179
interval2 = TimeInterval(
180180
cftime_datetime(2023, 1, 1, calendar="365_day"), cftime_datetime(2023, 1, 3, calendar="365_day")
181181
)
182-
with pytest.raises(ValueError, match="TimeIntervals are not compatible."):
182+
with pytest.raises(ValueError, match=r"TimeIntervals are not compatible."):
183183
interval1.intersection(interval2)
184184

185185

0 commit comments

Comments
 (0)