assert-every-dataclass-field-is-read 20260911130813__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/ask-gh-before-saying-github-cannot.md +3 -0
  2. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/commit-straight-to-main.md +3 -0
  3. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/cover-new-source-in-both-tiers.md +5 -0
  4. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/do-not-offer-a-pointless-choice.md +4 -0
  5. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/do-what-the-issue-says-and-stop.md +9 -0
  6. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/let-ci-run-the-checks.md +8 -0
  7. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/name-a-conftest-fixture-apart-from-what-it-asks-for.md +9 -0
  8. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/name-a-job-after-the-package-it-runs.md +9 -0
  9. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/pylint-refactor-messages-are-hard-failures.md +9 -0
  10. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/run-the-tool-before-writing-the-claim.md +4 -0
  11. assert_every_dataclass_field_is_read-20260911130813/.claude/memories/start-over-when-the-user-does-not-understand.md +8 -0
  12. assert_every_dataclass_field_is_read-20260911130813/.github/workflows/documentation.yml +26 -0
  13. assert_every_dataclass_field_is_read-20260911130813/.github/workflows/release.yml +336 -0
  14. assert_every_dataclass_field_is_read-20260911130813/.gitignore +54 -0
  15. assert_every_dataclass_field_is_read-20260911130813/CLAUDE.md +15 -0
  16. assert_every_dataclass_field_is_read-20260911130813/LICENSE.txt +190 -0
  17. assert_every_dataclass_field_is_read-20260911130813/PKG-INFO +159 -0
  18. assert_every_dataclass_field_is_read-20260911130813/README.md +135 -0
  19. assert_every_dataclass_field_is_read-20260911130813/action.yml +57 -0
  20. assert_every_dataclass_field_is_read-20260911130813/pyproject.toml +45 -0
  21. assert_every_dataclass_field_is_read-20260911130813/setup.cfg +4 -0
  22. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read/__init__.py +0 -0
  23. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read/__main__.py +3 -0
  24. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read/cli.py +285 -0
  25. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read/py.typed +0 -0
  26. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read/scanner.py +442 -0
  27. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/PKG-INFO +159 -0
  28. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/SOURCES.txt +44 -0
  29. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/dependency_links.txt +1 -0
  30. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/entry_points.txt +2 -0
  31. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/scm_file_list.json +41 -0
  32. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/scm_version.json +8 -0
  33. assert_every_dataclass_field_is_read-20260911130813/src/assert_every_dataclass_field_is_read.egg-info/top_level.txt +1 -0
  34. assert_every_dataclass_field_is_read-20260911130813/test/__init__.py +0 -0
  35. assert_every_dataclass_field_is_read-20260911130813/test/conftest.py +94 -0
  36. assert_every_dataclass_field_is_read-20260911130813/test/e2e/__init__.py +0 -0
  37. assert_every_dataclass_field_is_read-20260911130813/test/e2e/conftest.py +14 -0
  38. assert_every_dataclass_field_is_read-20260911130813/test/e2e/test_e2e.py +29 -0
  39. assert_every_dataclass_field_is_read-20260911130813/test/integration/__init__.py +0 -0
  40. assert_every_dataclass_field_is_read-20260911130813/test/integration/test_cli.py +176 -0
  41. assert_every_dataclass_field_is_read-20260911130813/test/runners.py +31 -0
  42. assert_every_dataclass_field_is_read-20260911130813/test/samples.py +295 -0
  43. assert_every_dataclass_field_is_read-20260911130813/test/unit/__init__.py +0 -0
  44. assert_every_dataclass_field_is_read-20260911130813/test/unit/test_cli.py +357 -0
  45. assert_every_dataclass_field_is_read-20260911130813/test/unit/test_main.py +20 -0
  46. assert_every_dataclass_field_is_read-20260911130813/test/unit/test_scanner.py +445 -0
@@ -0,0 +1,3 @@
1
+ # Ask gh before saying GitHub cannot
2
+
3
+ Check with `gh api` before telling the user GitHub cannot do something.
@@ -0,0 +1,3 @@
1
+ # Commit straight to main
2
+
3
+ Commit to `main` and push. Do not branch and do not open a pull request.
@@ -0,0 +1,5 @@
1
+ # Cover new source in both tiers
2
+
3
+ Every new branch in `src/` needs a unit test and an integration test. The
4
+ unit and integration jobs each demand 100% coverage of the whole source on
5
+ their own, so a line only one tier reaches fails the other.
@@ -0,0 +1,4 @@
1
+ # Do not offer a pointless choice
2
+
3
+ Where the options differ in nothing the user cares about, pick one and say
4
+ which. Asking makes them work out that the question did not matter.
@@ -0,0 +1,9 @@
1
+ # Do what the issue says and stop
2
+
3
+ An issue asking for a CI job means add the job. It does not authorise
4
+ rewriting the tree the job will check, however clearly the job will fail
5
+ on it. Push the job and let the run report; the cleanup is a separate
6
+ issue and a separate decision.
7
+
8
+ Learned on #5, where adding `no-comments` led to stripping every
9
+ docstring out of `src/` and `test/` before the job had ever run.
@@ -0,0 +1,8 @@
1
+ # Let CI run the checks
2
+
3
+ Never run locally what CI runs, and do not wait on a run after pushing.
4
+ Every job is free on GitHub and costs Claude tokens here. Push and let the
5
+ workflow report.
6
+
7
+ That covers pytest, mypy, pylint, jscpd, the assert-* tools and `gh run
8
+ watch`.
@@ -0,0 +1,9 @@
1
+ # Name a conftest fixture apart from what it asks for
2
+
3
+ A fixture that asks for another fixture defined in the same module trips
4
+ pylint's `redefined-outer-name`, which `--fail-on=C,R,W` treats as a
5
+ failure. Inline directives are banned here, so the only route is to name
6
+ the function apart from the fixture: `@pytest.fixture(name="run_over")` on
7
+ `def run_over_fixture(write_tree, run_cli)`. The parameter then shadows
8
+ nothing. This only bites inside a conftest; a test module has no
9
+ module-level name to shadow.
@@ -0,0 +1,9 @@
1
+ # Name a job after the package it runs
2
+
3
+ A CI job that runs a published tool takes that tool's name in full:
4
+ `assert-no-comments`, not `no-comments`. The short names the workflow
5
+ carried before were not a convention anyone chose, so do not read one out
6
+ of the file and extend it.
7
+
8
+ yamllint runs with `key-ordering: enable`, so a renamed job has to move to
9
+ its new alphabetical place under `jobs:` as well.
@@ -0,0 +1,9 @@
1
+ # pylint refactor messages are hard failures
2
+
3
+ `--fail-on=C,R,W` means pylint's R messages fail the job, so its default
4
+ limits are hard limits here: 5 arguments, 15 locals, 12 branches, 50
5
+ statements per function. Inline directives are banned, so the only route
6
+ is to split the function.
7
+
8
+ That is why `main` hands its work to `_findings_for` rather than growing
9
+ another local for each mode it grew.
@@ -0,0 +1,4 @@
1
+ # Run the tool before writing the claim into an issue
2
+
3
+ Do not write into an issue what this tool does until you have run it and
4
+ read the output.
@@ -0,0 +1,8 @@
1
+ # Start over when the user does not understand
2
+
3
+ Go back to the smallest concrete example and build up from there. Do not
4
+ restate the same explanation with more detail attached.
5
+
6
+ A small example is not enough on its own if the words around it are the
7
+ project's own vocabulary. Drop the jargon too: say what the tool does and
8
+ what goes wrong in plain words a stranger would follow.
@@ -0,0 +1,26 @@
1
+ ---
2
+ concurrency:
3
+ cancel-in-progress: true
4
+ group: ${{ github.workflow }}-${{ github.ref }}
5
+ jobs:
6
+ markdownlint:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - name: Checkout code
10
+ uses: actions/checkout@v7
11
+ - name: Set up Node
12
+ uses: actions/setup-node@v7
13
+ with:
14
+ node-version: "20"
15
+ - name: Install dependencies
16
+ run: npm install -g markdownlint-cli
17
+ - name: markdownlint
18
+ run: markdownlint '**/*.md'
19
+ name: documentation
20
+ on:
21
+ push:
22
+ branches:
23
+ - main
24
+ paths:
25
+ - "**/*.md"
26
+ - ".github/workflows/documentation.yml"
@@ -0,0 +1,336 @@
1
+ ---
2
+ concurrency:
3
+ cancel-in-progress: true
4
+ group: ${{ github.workflow }}-${{ github.ref }}
5
+ jobs:
6
+ assert-every-dataclass-field-is-read:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - name: Checkout code
10
+ uses: actions/checkout@v7
11
+ - name: Set up Python
12
+ uses: actions/setup-python@v7
13
+ with:
14
+ python-version: "3.13"
15
+ - name: Install dependencies
16
+ run: pip install -e .
17
+ - name: assert-every-dataclass-field-is-read
18
+ run: >-
19
+ assert-every-dataclass-field-is-read
20
+ src
21
+ --search-in src
22
+ --search-in test
23
+ --verbose
24
+ assert-no-comments:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - name: Checkout code
28
+ uses: actions/checkout@v7
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v7
31
+ with:
32
+ python-version: "3.13"
33
+ - name: Install dependencies
34
+ run: pip install assert-no-comments
35
+ - name: assert-no-comments
36
+ run: >-
37
+ assert-no-comments
38
+ --verbose
39
+ ${{ github.workspace }}
40
+ assert-no-inline-directives:
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - name: Checkout code
44
+ uses: actions/checkout@v7
45
+ - name: Set up Python
46
+ uses: actions/setup-python@v7
47
+ with:
48
+ python-version: "3.13"
49
+ - name: Install dependencies
50
+ run: pip install assert-no-inline-directives
51
+ - name: assert-no-inline-directives
52
+ run: >-
53
+ assert-no-inline-directives
54
+ --tools pylint,mypy,yamllint
55
+ --verbose
56
+ ${{ github.workspace }}/**/*
57
+ assert-no-linter-config-files:
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - name: Checkout code
61
+ uses: actions/checkout@v7
62
+ - name: Set up Python
63
+ uses: actions/setup-python@v7
64
+ with:
65
+ python-version: "3.13"
66
+ - name: Install dependencies
67
+ run: pip install assert-no-linter-config-files
68
+ - name: assert-no-linter-config-files
69
+ run: >-
70
+ assert-no-linter-config-files
71
+ --linters pylint,mypy,yamllint
72
+ --verbose
73
+ ${{ github.workspace }}
74
+ assert-one-assert-per-pytest:
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - name: Checkout code
78
+ uses: actions/checkout@v7
79
+ - name: Set up Python
80
+ uses: actions/setup-python@v7
81
+ with:
82
+ python-version: "3.13"
83
+ - name: Install dependencies
84
+ run: pip install assert-one-assert-per-pytest
85
+ - name: assert-one-assert-per-pytest
86
+ run: >-
87
+ assert-one-assert-per-pytest
88
+ --verbose
89
+ ${{ github.workspace }}/test
90
+ assert-python-definition-is-used:
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - name: Checkout code
94
+ uses: actions/checkout@v7
95
+ - name: Set up Python
96
+ uses: actions/setup-python@v7
97
+ with:
98
+ python-version: "3.13"
99
+ - name: Install dependencies
100
+ run: pip install assert-python-definition-is-used
101
+ - name: assert-python-definition-is-used
102
+ run: >-
103
+ assert-python-definition-is-used
104
+ src
105
+ --search-in src
106
+ --search-in test
107
+ --verbose
108
+ e2e-tests:
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - name: Checkout code
112
+ uses: actions/checkout@v7
113
+ - name: Set up Python
114
+ uses: actions/setup-python@v7
115
+ with:
116
+ python-version: "3.13"
117
+ - name: Install dependencies
118
+ run: pip install pytest -e .
119
+ - name: E2E tests
120
+ run: python3 -m pytest test/e2e/ --verbose --pythonwarnings=error
121
+ integration-tests:
122
+ runs-on: ubuntu-latest
123
+ steps:
124
+ - name: Checkout code
125
+ uses: actions/checkout@v7
126
+ - name: Set up Python
127
+ uses: actions/setup-python@v7
128
+ with:
129
+ python-version: "3.13"
130
+ - name: Install dependencies
131
+ run: pip install pytest pytest-cov -e .
132
+ - name: Integration tests
133
+ run: |
134
+ python3 -m pytest test/integration/ \
135
+ --verbose --pythonwarnings=error \
136
+ --cov=assert_every_dataclass_field_is_read \
137
+ --cov-branch \
138
+ --cov-report=term-missing \
139
+ --cov-fail-under=100
140
+ jscpd-src:
141
+ runs-on: ubuntu-latest
142
+ steps:
143
+ - name: Checkout code
144
+ uses: actions/checkout@v7
145
+ - name: Set up Node
146
+ uses: actions/setup-node@v7
147
+ with:
148
+ node-version: "20"
149
+ - name: Install dependencies
150
+ run: npm install -g jscpd
151
+ - name: jscpd (src)
152
+ run: jscpd --pattern "**/*.py" --threshold 0 --reporters console src/
153
+ jscpd-test:
154
+ runs-on: ubuntu-latest
155
+ steps:
156
+ - name: Checkout code
157
+ uses: actions/checkout@v7
158
+ - name: Set up Node
159
+ uses: actions/setup-node@v7
160
+ with:
161
+ node-version: "20"
162
+ - name: Install dependencies
163
+ run: npm install -g jscpd
164
+ - name: jscpd (test)
165
+ run: jscpd --pattern "**/*.py" --threshold 0 --reporters console test/
166
+ mypy-src:
167
+ runs-on: ubuntu-latest
168
+ steps:
169
+ - name: Checkout code
170
+ uses: actions/checkout@v7
171
+ - name: Set up Python
172
+ uses: actions/setup-python@v7
173
+ with:
174
+ python-version: "3.13"
175
+ - name: Install dependencies
176
+ run: pip install mypy -e .
177
+ - name: mypy (src)
178
+ run: python3 -m mypy --strict src/
179
+ mypy-test:
180
+ runs-on: ubuntu-latest
181
+ steps:
182
+ - name: Checkout code
183
+ uses: actions/checkout@v7
184
+ - name: Set up Python
185
+ uses: actions/setup-python@v7
186
+ with:
187
+ python-version: "3.13"
188
+ - name: Install dependencies
189
+ run: pip install mypy pytest -e .
190
+ - name: mypy (test)
191
+ run: python3 -m mypy test/
192
+ pylint-src:
193
+ runs-on: ubuntu-latest
194
+ steps:
195
+ - name: Checkout code
196
+ uses: actions/checkout@v7
197
+ - name: Set up Python
198
+ uses: actions/setup-python@v7
199
+ with:
200
+ python-version: "3.13"
201
+ - name: Install dependencies
202
+ run: pip install pylint -e .
203
+ - name: pylint (src)
204
+ run: >-
205
+ python3 -m pylint src/
206
+ --disable=missing-class-docstring
207
+ --disable=missing-function-docstring
208
+ --disable=missing-module-docstring
209
+ --fail-on=C,R,W
210
+ --fail-under=10.0
211
+ pylint-test:
212
+ runs-on: ubuntu-latest
213
+ steps:
214
+ - name: Checkout code
215
+ uses: actions/checkout@v7
216
+ - name: Set up Python
217
+ uses: actions/setup-python@v7
218
+ with:
219
+ python-version: "3.13"
220
+ - name: Install dependencies
221
+ run: pip install pylint pytest -e .
222
+ - name: pylint (test)
223
+ run: >-
224
+ python3 -m pylint test/
225
+ --disable=missing-class-docstring
226
+ --disable=missing-function-docstring
227
+ --disable=missing-module-docstring
228
+ --fail-on=C,R,W
229
+ --fail-under=10.0
230
+ release:
231
+ if: github.event_name == 'push'
232
+ needs:
233
+ - assert-every-dataclass-field-is-read
234
+ - assert-no-comments
235
+ - assert-no-inline-directives
236
+ - assert-no-linter-config-files
237
+ - assert-one-assert-per-pytest
238
+ - assert-python-definition-is-used
239
+ - e2e-tests
240
+ - integration-tests
241
+ - jscpd-src
242
+ - jscpd-test
243
+ - mypy-src
244
+ - mypy-test
245
+ - pylint-src
246
+ - pylint-test
247
+ - unit-tests
248
+ - yamllint
249
+ permissions:
250
+ contents: write
251
+ id-token: write
252
+ runs-on: ubuntu-latest
253
+ steps:
254
+ - name: Checkout code
255
+ uses: actions/checkout@v7
256
+ with:
257
+ fetch-depth: 0
258
+ - name: Set up Python
259
+ uses: actions/setup-python@v7
260
+ with:
261
+ python-version: "3.13"
262
+ - id: version
263
+ name: Generate version from UTC time
264
+ run: echo "version=$(date -u +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
265
+ - name: Create tag
266
+ run: git tag "v${{ steps.version.outputs.version }}"
267
+ - name: Install build tools
268
+ run: pip install build
269
+ - name: Build package
270
+ run: python -m build
271
+ - name: Publish to PyPI
272
+ uses: pypa/gh-action-pypi-publish@release/v1
273
+ - name: Push tag
274
+ run: git push origin "v${{ steps.version.outputs.version }}"
275
+ - env:
276
+ GH_TOKEN: ${{ github.token }}
277
+ name: Create GitHub Release
278
+ run: |
279
+ gh release create "v${{ steps.version.outputs.version }}" \
280
+ --generate-notes
281
+ - name: Update latest tag
282
+ run: |
283
+ git tag -f latest
284
+ git push origin latest --force
285
+ unit-tests:
286
+ runs-on: ubuntu-latest
287
+ steps:
288
+ - name: Checkout code
289
+ uses: actions/checkout@v7
290
+ - name: Set up Python
291
+ uses: actions/setup-python@v7
292
+ with:
293
+ python-version: "3.13"
294
+ - name: Install dependencies
295
+ run: pip install pytest pytest-cov -e .
296
+ - name: Unit tests
297
+ run: |
298
+ python3 -m pytest test/unit/ \
299
+ --verbose --pythonwarnings=error \
300
+ --cov=assert_every_dataclass_field_is_read \
301
+ --cov-branch \
302
+ --cov-report=term-missing \
303
+ --cov-fail-under=100
304
+ yamllint:
305
+ runs-on: ubuntu-latest
306
+ steps:
307
+ - name: Checkout code
308
+ uses: actions/checkout@v7
309
+ - name: Set up Python
310
+ uses: actions/setup-python@v7
311
+ with:
312
+ python-version: "3.13"
313
+ - name: Install dependencies
314
+ run: pip install yamllint
315
+ - name: yamllint
316
+ run: |
317
+ EMPTY_LINES='empty-lines: {max: 0, max-start: 0, max-end: 1}'
318
+ KEY_ORDERING='key-ordering: enable'
319
+ TRUTHY='truthy: {allowed-values: ["true", "false", "on"]}'
320
+ RULES="$EMPTY_LINES, $KEY_ORDERING, $TRUTHY"
321
+ shopt -s globstar
322
+ yamllint --strict --format github \
323
+ --config-data "{extends: default, rules: {$RULES}}" \
324
+ *.yml **/*.yml
325
+ name: release
326
+ on:
327
+ push:
328
+ branches:
329
+ - main
330
+ paths:
331
+ - ".github/workflows/documentation.yml"
332
+ - ".github/workflows/release.yml"
333
+ - "action.yml"
334
+ - "pyproject.toml"
335
+ - "src/**"
336
+ - "test/**"
@@ -0,0 +1,54 @@
1
+ *$py.class
2
+ *.cover
3
+ *.egg
4
+ *.egg-info/
5
+ *.manifest
6
+ *.mo
7
+ *.pot
8
+ *.py,cover
9
+ *.py[cod]
10
+ *.so
11
+ *.spec
12
+ *.swo
13
+ *.swp
14
+ .DS_Store
15
+ .Python
16
+ .cache
17
+ .coverage
18
+ .coverage.*
19
+ .dmypy.json
20
+ .eggs/
21
+ .env
22
+ .hypothesis/
23
+ .idea/
24
+ .installed.cfg
25
+ .mypy_cache/
26
+ .nox/
27
+ .pytest_cache/
28
+ .ruff_cache/
29
+ .tox/
30
+ .venv
31
+ .vscode/
32
+ ENV/
33
+ __pycache__/
34
+ build/
35
+ coverage.xml
36
+ develop-eggs/
37
+ dist/
38
+ dmypy.json
39
+ downloads/
40
+ eggs/
41
+ env.bak/
42
+ env/
43
+ htmlcov/
44
+ lib/
45
+ lib64/
46
+ nosetests.xml
47
+ parts/
48
+ pip-delete-this-directory.txt
49
+ pip-log.txt
50
+ sdist/
51
+ var/
52
+ venv.bak/
53
+ venv/
54
+ wheels/
@@ -0,0 +1,15 @@
1
+ # CLAUDE.md
2
+
3
+ ## Memories
4
+
5
+ Everything learned about this repository lives in `.claude/memories/`, one
6
+ lesson per file, named after the lesson in kebab-case. Read every file in
7
+ that directory before starting work here. Nothing else is loaded
8
+ automatically, so a lesson that is not read is a lesson not learned.
9
+
10
+ Write a memory when a belief about this repository or its tooling is
11
+ corrected, when a decision is made whose reasoning would not survive in the
12
+ diff, or when the user gives guidance on how work here should be done. Lead
13
+ with the rule, and add how it was learned only where that changes what to do
14
+ next. Update the memory that already covers the ground rather than adding a
15
+ second, and delete one that turns out to be wrong.