Skip to content

Commit 042b2f7

Browse files
committed
Bump ruff.
1 parent c006579 commit 042b2f7

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.2
3+
rev: v0.12.5
44
hooks:
5-
- id: ruff
5+
- id: ruff-check
66
args: [ --fix ]
77
- id: ruff-format

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
# General information about the project.
4848
project = "w3lib"
49-
copyright = "2014, w3lib developers"
49+
project_copyright = "2014, w3lib developers"
5050

5151
# The version info for the project you're documenting, acts as replacement for
5252
# |version| and |release|, also used in various other places throughout the

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ disable = [
116116

117117
[tool.ruff.lint]
118118
extend-select = [
119+
# flake8-builtins
120+
"A",
121+
# flake8-async
122+
"ASYNC",
119123
# flake8-bugbear
120124
"B",
121125
# flake8-comprehensions
122126
"C4",
127+
# flake8-commas
128+
"COM",
123129
# pydocstyle
124130
"D",
125131
# flake8-future-annotations
@@ -176,6 +182,8 @@ extend-select = [
176182
ignore = [
177183
# Within an `except` clause, raise exceptions with `raise ... from`
178184
"B904",
185+
# Trailing comma missing
186+
"COM812",
179187
# Missing docstring in public module
180188
"D100",
181189
# Missing docstring in public class
@@ -232,5 +240,8 @@ ignore = [
232240
"S101",
233241
]
234242

243+
[tool.ruff.lint.isort]
244+
split-on-trailing-comma = false
245+
235246
[tool.ruff.lint.pydocstyle]
236247
convention = "pep257"

tests/test_encoding.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import annotations
22

33
import codecs
4+
import random
5+
from io import BytesIO
46
from typing import Any
57

68
from w3lib.encoding import (
@@ -266,9 +268,6 @@ def test_utf16_32(self):
266268
self._assert_encoding("utf-32", "hi".encode("utf-32-be"), "utf-32-be", "hi")
267269

268270
def test_python_crash(self):
269-
import random
270-
from io import BytesIO
271-
272271
random.seed(42)
273272
buf = BytesIO()
274273
for _ in range(150000):

0 commit comments

Comments
 (0)