Skip to content

Commit 5a98f85

Browse files
[3.13] pythonGH-139590: Run ruff format on pre-commit for Tools/wasm (pythonGH-139591) (python#139745)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent de84a03 commit 5a98f85

File tree

5 files changed

+246
-121
lines changed

5 files changed

+246
-121
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ repos:
2626
name: Run Ruff (format) on Doc/
2727
args: [--check]
2828
files: ^Doc/
29+
- id: ruff-format
30+
name: Run Ruff (format) on Tools/wasm/
31+
args: [--check, --config=Tools/wasm/.ruff.toml]
32+
files: ^Tools/wasm/
2933

3034
- repo: https://github.com/psf/black-pre-commit-mirror
3135
rev: 25.1.0

Tools/wasm/.ruff.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extend = "../../.ruff.toml" # Inherit the project-wide settings
2+
3+
[format]
4+
preview = true
5+
docstring-code-format = true
6+
7+
[lint]
8+
select = [
9+
"C4", # flake8-comprehensions
10+
"E", # pycodestyle
11+
"F", # pyflakes
12+
"I", # isort
13+
"ISC", # flake8-implicit-str-concat
14+
"LOG", # flake8-logging
15+
"PGH", # pygrep-hooks
16+
"PT", # flake8-pytest-style
17+
"PYI", # flake8-pyi
18+
"RUF100", # Ban unused `# noqa` comments
19+
"UP", # pyupgrade
20+
"W", # pycodestyle
21+
"YTT", # flake8-2020
22+
]
23+
ignore = [
24+
"E501", # Line too long
25+
"F541", # f-string without any placeholders
26+
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
27+
"PYI025", # Use `from collections.abc import Set as AbstractSet`
28+
]

0 commit comments

Comments
 (0)