Skip to content

Commit a5173b1

Browse files
committed
Update ruff
1 parent fe74d1c commit a5173b1

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ select = [
173173
"UP", "F", "C4", "ANN", "B", "PIE", "RUF",
174174
"PLC", "PLE", "PLW", # Pylint.
175175

176-
"TCH005", # Empty type-checking block.
176+
"TC005", # Empty type-checking block.
177177
]
178178
allowed-confusables = [
179179
"×", # Multiplication sign
@@ -185,9 +185,6 @@ extend-ignore = [
185185
"F405",
186186
"F841", # Unused local var, detects tuple unpacks.
187187
# Flake8-annotations.
188-
# Type annotations for self & cls are not important.
189-
"ANN101",
190-
"ANN102",
191188
# Allow typing.Any
192189
"ANN401",
193190

src/srctools/choreo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class CurveType:
150150
@classmethod
151151
def parse_text(cls, text: str) -> CurveType:
152152
"""Parse text in the form 'curve_AAA_to_curve_BBB'."""
153-
match = re.match('curve_([a-z_]+)_to_curve_([a-z_]+)', text.casefold())
153+
match = re.match(r'curve_([a-z_]+)_to_curve_([a-z_]+)', text.casefold())
154154
if match is None:
155155
raise ValueError('Invalid curve type text.')
156156
left, right = match.groups()

src/srctools/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def log(
108108
level: int,
109109
msg: Any,
110110
*args: Any,
111-
exc_info: Union[None, bool, _SysExcInfoType, BaseException] = None,
111+
exc_info: Union[bool, _SysExcInfoType, BaseException, None] = None,
112112
stack_info: bool = False,
113113
extra: Optional[Mapping[str, object]] = None,
114114
stacklevel: int = 0,
@@ -413,7 +413,7 @@ def error_closure(exc: BaseException) -> None:
413413
stdout_loghandler = logging.StreamHandler(sys.stdout)
414414
stdout_loghandler.setLevel(
415415
logging.DEBUG
416-
if os.environ.get('SRCTOOLS_DEBUG', 0) == '1' else
416+
if os.environ.get('SRCTOOLS_DEBUG', '0') == '1' else
417417
logging.INFO
418418
)
419419
stdout_loghandler.setFormatter(short_log_format)

tests/test_vec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def test_bbox(frozen_thawed_vec: VecClass) -> None:
15001500
Vec.bbox(Vec(), None)
15011501

15021502
# Empty iterable.
1503-
with pytest.raises(ValueError, match=re.compile('empty', re.IGNORECASE)):
1503+
with pytest.raises(ValueError, match=re.compile(r'empty', re.IGNORECASE)):
15041504
Vec.bbox([])
15051505

15061506
# Iterable starting with non-vector.

tool-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ types-Pillow>=8.3.0
33
types-pyinstaller>=5.7.0
44
mypy == 1.13.0
55
pyright == 1.1.383
6-
ruff == 0.7.1
6+
ruff == 0.8.1

0 commit comments

Comments
 (0)