Skip to content

Commit

Permalink
Enable RUF100 check (#noqa) and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jun 24, 2023
1 parent c1e2469 commit c882111
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ select = [
"D", # pydocstyle
]
target-version = "py310"
extend-select = [
"RUF100", # Warn about unused noqa
]

[tool.ruff.per-file-ignores]
"python/lsst/daf/butler/registry/queries/expressions/parser/parserYacc.py" = ["D401", "D403"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,11 @@ def __eq__(self, other: Any) -> bool:
def __getitem__(self, index: int) -> DataCoordinate:
pass

@overload # noqa: F811 (FIXME: remove for py 3.8+)
def __getitem__(self, index: slice) -> DataCoordinateSequence: # noqa: F811
@overload
def __getitem__(self, index: slice) -> DataCoordinateSequence:
pass

def __getitem__(self, index: Any) -> Any: # noqa: F811
def __getitem__(self, index: Any) -> Any:
r = self._dataIds[index]
if isinstance(index, slice):
return DataCoordinateSequence(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def p_predicate(self, p):
else:
p[0] = p[1]

def p_identifier(self, p): # noqa: D401, D403
def p_identifier(self, p):
"""identifier : SIMPLE_IDENTIFIER
| QUALIFIED_IDENTIFIER
"""
Expand Down
4 changes: 1 addition & 3 deletions tests/test_cliUtilSplitCommas.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def test_separate(self):
"""Test the split_commas callback by itself."""
ctx = "unused"
param = "unused"
self.assertEqual(
split_commas(ctx, param, ("one,two", "three,four")), ("one", "two", "three", "four") # noqa E231
)
self.assertEqual(split_commas(ctx, param, ("one,two", "three,four")), ("one", "two", "three", "four"))
self.assertEqual(split_commas(ctx, param, None), tuple())

def test_single(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_matplotlibFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
try:
import matplotlib

matplotlib.use("Agg") # noqa:E402
matplotlib.use("Agg")
from matplotlib import pyplot
except ImportError:
pyplot = None
Expand Down

0 comments on commit c882111

Please sign in to comment.