Skip to content

Commit 0030e04

Browse files
committed
Distribute the rules more correctly
1 parent 206b5d2 commit 0030e04

File tree

6 files changed

+40
-36
lines changed

6 files changed

+40
-36
lines changed

.github/workflows/check-codestyle.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,16 @@ jobs:
8787

8888
typos-check:
8989
runs-on: ubuntu-latest
90-
strategy:
91-
fail-fast: false
92-
matrix:
93-
include:
94-
# Group 1
95-
- name: "General"
96-
config: "./typos_modules/general.toml"
97-
path: "."
98-
args: ""
99-
100-
# Group 2
101-
- name: "ND"
102-
config: "./typos_modules/nd.toml"
103-
path: "./src/*/nd"
104-
args: ""
105-
106-
name: Typos / ${{ matrix.name }}
10790
steps:
10891
- uses: actions/checkout@v4
10992

93+
- name: Find typos configs
94+
id: search
95+
run: |
96+
echo "cfg=$(find . -type f \( -name "pyproject.toml" -o -name "typos.toml" -o -name ".typos.toml" \))" \
97+
>> $GITHUB_OUTPUT
98+
11099
- name: Check spelling with typos
111100
uses: crate-ci/typos@v1.39.2
112101
with:
113-
files: ${{ matrix.path }}
114-
config: ${{ matrix.config }}
115-
args: ${{ matrix.args }}
102+
config: ${{ steps.search.outputs.cfg }}

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,27 @@ exclude = [
5050
"examples/*",
5151
]
5252

53+
[tool.typos]
54+
[tool.typos.files]
55+
extend-exclude = [
56+
"test_input_data/",
57+
]
58+
[tool.typos.default]
59+
extend-ignore-re = [
60+
"countr_zero",
61+
"BA thesis.pdf",
62+
"Peter J. Hass",
63+
"Comput. J.",
64+
"\"ba\"",
65+
]
66+
extend-ignore-words-re = [
67+
"^(nd|ND|Nd)$",
68+
]
69+
extend-ignore-identifier-re = [
70+
"^(nd|ND|Nd)$",
71+
]
72+
[tool.typos.type.jupyter]
73+
extend-ignore-re = [
74+
'\"id":\s*"[^"\n]*"',
75+
'"outputs"\s*:\s*\[(\s*\{[^}]*\}(?:,\s*\{[^}]*\})*)?\s*\]'
76+
]

src/python_bindings/.typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default]
2+
extend-ignore-words-re = [
3+
"abd",
4+
]

src/tests/unit/.typos.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[default]
2+
extend-ignore-words-re = [
3+
"abd",
4+
"helo",
5+
]

typos_modules/general.toml

Lines changed: 0 additions & 8 deletions
This file was deleted.

typos_modules/nd.toml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)