Skip to content

Commit 03be1d9

Browse files
committed
ruff.toml: renaming and updating rules
1 parent cdd9646 commit 03be1d9

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

.ruff.toml renamed to ruff.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ fix = true # auto-fix findings
22
line-length = 88 # same as Black
33
target-version = "py313" # Python 3.13
44

5+
# extend-exclude = ["src/MyBadFile1.py"]
6+
7+
58
[lint]
69
# comment this out to use only default rules (["E4", "E7", "E9", "F"])
7-
select = ["ALL"] # activate all rules
10+
select = ["ALL"] # activate all rules
11+
fixable = ["ALL"] # fix for all enabled rules
812

913
# add some more rules to include
1014
# extend-select = ["B", "Q", "E", "W"]
@@ -13,17 +17,18 @@ select = ["ALL"] # activate all rules
1317
extend-ignore = [
1418
"COM812", # missing-trailing-comma,
1519
"D200", # fits-on-one-line"
20+
"D203", # incorrect-blank-line-before-class
1621
"D211", # blank-line-before-class
1722
"D212", # multi-line-summary-second-line
1823
"ERA", # commented-out code
1924
"FIX002", # line-contains-todo
2025
"ISC001", # implicit-str-concat
21-
"PD901", # df name
2226
"PGH003", # blanket-type-ignore
2327
"RET504", # unnecessary-assign
2428
"T201", # print
2529
"TD002", # missing-todo-author
2630
"TD003", # missing-todo-link
31+
"S101", # use of asserts
2732
]
2833

2934

scripts/check_chapters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# by Torben Menke https://entorb.net
33

4-
# ruff: noqa: S101 RUF001 RUF003 D103
4+
# ruff: noqa: RUF001, RUF003, D103
55

66
"""
77
Check chapter .tex files for known issues and propose fixes.

scripts/check_chapters_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Tests for check_chapters.py .""" # noqa: INP001
2-
# ruff: noqa: S101, RUF001, D103
2+
# ruff: noqa: RUF001, D103
33

44
from collections.abc import Callable
55

scripts/ebook/step_4_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Unit Tests.""" # noqa: INP001
2-
# ruff: noqa: S101
32

43
from step_4 import convert_parsel
54

scripts/ebook/step_6_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Unit Tests.""" # noqa: INP001
2-
# ruff: noqa: S101
32

43
from step_6 import fix_ellipsis
54

scripts/ebook/v1/1_latex2html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,6 @@ def find_tex_commands(s: str) -> list:
847847
):
848848
print(f"{value}\t{key}")
849849

850-
assert (
851-
len(d_tex_commands_unhandled) == 0
852-
), "Error: unhandled LaTeX commands found, see above"
850+
assert len(d_tex_commands_unhandled) == 0, (
851+
"Error: unhandled LaTeX commands found, see above"
852+
)

0 commit comments

Comments
 (0)