Commit 9cd6bde
authored
Last batch of ruff rules (#658)
* Enforce ruff rule RUF001
Disable the rule directly in the incriminated test file.
* Enforce ruff/pyupgrade rule UP007
UP007 Use `X | Y` for type annotations
* Enforce ruff/flake8-bugbear rules B028 and B904
* Exclude c-blosc from ruff linting
* Ignore ruff/pycodestyle rule W391
astral-sh/ruff#13763
* Enforce ruff/flake8-logging rules (LOG)
* Enforce ruff/flake8-implicit-str-concat rules (ISC)
* Enforce ruff/flake8-executable rules (EXE)
* Enforce ruff/flake8-future-annotations rules (FA)
* Enforce ruff/flake8-return rules (RET)
* Enforce ruff/flake8-slots rules (SLOT)
* Add "numcodecs" to "src"
The directories to consider when resolving first- vs. third-party imports.
* Enforce ruff/flake8-simplify rules (SIM)
* Enforce ruff/flake8-tidy-imports rules (TID)
* Conflicting ruff lint rules
The linter includes some rules that, when enabled, can cause conflicts
with the formatter, leading to unexpected behavior. None None of these
rules are included in Ruff's default configuration. However, since we
have enabled some relevant rule sets, we disable these rules.
* Enforce ruff/tryceratops rules (TRY)
* Update ruff to 0.8.0
* Ignore ruff/flake8-simplify rule SIM105
SIM105 Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pass`
* Ignore ruff/tryceratops rule TRY301
TRY301 Abstract `raise` to an inner function
* Apply ruff/flake8-bugbear rule B904
B904 Within an `except` clause, raise exceptions with `raise ... from err`
or `raise ... from None` to distinguish them from errors in exception
handling
* Apply ruff/flake8-bugbear rule B028
B028 No explicit `stacklevel` keyword argument found
* Apply ruff rule RUF022
RUF022 `__all__` is not sorted1 parent bfa1c0d commit 9cd6bde
File tree
18 files changed
+74
-82
lines changed- adhoc
- notebooks
- numcodecs
- tests
18 files changed
+74
-82
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 62 | + | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
95 | 92 | | |
96 | 93 | | |
97 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 88 | + | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments