Skip to content

Commit

Permalink
ci: Enable RUF ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Mar 22, 2024
1 parent bf24054 commit e5a81d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ select = [
"RSE",
# flake-return
"RET",
# Ruff rules
"RUF",
]

ignore = [
Expand All @@ -124,7 +126,9 @@ ignore = [
"B904",
"D100",
"D104",
"D107"
"D107",
"RUF009",
"RUF012",
]

[tool.ruff.lint.per-file-ignores]
Expand Down
7 changes: 2 additions & 5 deletions tests/formats/dataclass/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,11 +883,8 @@ def test_default_imports_combo(self):
" field: Optional[str] = field(default=None)"
)

expected = "\n".join(
(
"from dataclasses import dataclass, field",
"from typing import Optional",
)
expected = (
"from dataclasses import dataclass, field\nfrom typing import Optional"
)

self.assertEqual(expected, self.filters.default_imports(output))
Expand Down
2 changes: 1 addition & 1 deletion xsdata/utils/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def parse_offset(self) -> Optional[int]:
self.vidx += 1
return 0

if ctrl == "-" or ctrl == "+":
if ctrl in ("-", "+"):
self.vidx += 1
offset = self.parse_digits(2) * 60
self.skip(":")
Expand Down

0 comments on commit e5a81d0

Please sign in to comment.