brash 0.1.0__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 (44) hide show
  1. brash-0.1.0/.editorconfig +22 -0
  2. brash-0.1.0/.github/workflows/ci.yml +68 -0
  3. brash-0.1.0/.github/workflows/publish.yml +84 -0
  4. brash-0.1.0/.github/workflows/tag.yml +90 -0
  5. brash-0.1.0/.gitignore +223 -0
  6. brash-0.1.0/.rumdl_cache/.gitignore +2 -0
  7. brash-0.1.0/.rumdl_cache/0.3.5/5d27b7ebe2be4e0e6cedad0d85f31c03489ad3d68ef1ef6e0f8180dd83e05307_099a0c69894aedfc.json +10 -0
  8. brash-0.1.0/.rumdl_cache/0.3.5/766e68abccd6c83a22cde956012fad071c8fafe621f9e1645c693aa1f392d34d_099a0c69894aedfc.json +10 -0
  9. brash-0.1.0/.rumdl_cache/0.3.5/7b72c0eaef6acef4f6f2b4ef894ac332371bb352f1cb51c8cc1a9ce595ae69c8_099a0c69894aedfc.json +10 -0
  10. brash-0.1.0/.rumdl_cache/0.3.5/85491b8330474cf7b3e4688c23b45ab0e6804426ccca401f245b6a4fe8790402_099a0c69894aedfc.json +10 -0
  11. brash-0.1.0/.rumdl_cache/0.3.5/8733af4ba38c46a600729619ef69733590be2ada489b0d2c27b99e3ddeb9098a_099a0c69894aedfc.json +10 -0
  12. brash-0.1.0/.rumdl_cache/0.3.5/d846fe9fb4bcf1fed1aa1ece46b9501de4671f14f0a51131c6f912b353e71080_099a0c69894aedfc.json +10 -0
  13. brash-0.1.0/.rumdl_cache/0.3.5/eb5f48bc10e0c22ebc0d90b72401142f812ff998d8107c18dc572adc562fde08_099a0c69894aedfc.json +10 -0
  14. brash-0.1.0/.rumdl_cache/CACHEDIR.TAG +2 -0
  15. brash-0.1.0/.rumdl_cache/workspace_index.bin +0 -0
  16. brash-0.1.0/AGENTS.md +78 -0
  17. brash-0.1.0/CLAUDE.md +1 -0
  18. brash-0.1.0/LICENSE +21 -0
  19. brash-0.1.0/Makefile +32 -0
  20. brash-0.1.0/PKG-INFO +215 -0
  21. brash-0.1.0/README.md +186 -0
  22. brash-0.1.0/pyproject.toml +175 -0
  23. brash-0.1.0/src/brash/__init__.py +82 -0
  24. brash-0.1.0/src/brash/command.py +35 -0
  25. brash-0.1.0/src/brash/doc_comments.py +173 -0
  26. brash-0.1.0/src/brash/final_constants.py +226 -0
  27. brash-0.1.0/src/brash/general_params.py +665 -0
  28. brash-0.1.0/src/brash/py.typed +0 -0
  29. brash-0.1.0/src/brash/registry.py +100 -0
  30. brash-0.1.0/src/brash/run.py +166 -0
  31. brash-0.1.0/src/brash/type_aliases.py +309 -0
  32. brash-0.1.0/tests/__init__.py +0 -0
  33. brash-0.1.0/tests/cases/doc-comments.md +410 -0
  34. brash-0.1.0/tests/cases/final-constants.md +339 -0
  35. brash-0.1.0/tests/cases/general-params.md +818 -0
  36. brash-0.1.0/tests/cases/type-aliases.md +355 -0
  37. brash-0.1.0/tests/helpers.py +68 -0
  38. brash-0.1.0/tests/test_doc_comments.py +36 -0
  39. brash-0.1.0/tests/test_final_constants.py +36 -0
  40. brash-0.1.0/tests/test_general_params.py +52 -0
  41. brash-0.1.0/tests/test_registry.py +172 -0
  42. brash-0.1.0/tests/test_run.py +129 -0
  43. brash-0.1.0/tests/test_type_aliases.py +40 -0
  44. brash-0.1.0/uv.lock +321 -0
@@ -0,0 +1,22 @@
1
+ # EditorConfig: https://editorconfig.org
2
+ # Line length is 120 for every file type. See AGENTS.md.
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+ indent_style = space
11
+ indent_size = 4
12
+ max_line_length = 120
13
+
14
+ [*.{toml,yml,yaml,json}]
15
+ indent_size = 2
16
+
17
+ [*.md]
18
+ # Two trailing spaces are a hard line break in Markdown.
19
+ trim_trailing_whitespace = false
20
+
21
+ [Makefile]
22
+ indent_style = tab
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # Every uv command refuses a uv.lock that is out of date with pyproject.toml, not only the explicit `uv sync
12
+ # --locked`: the `uv run` calls after it, in make, would otherwise re-lock and sync quietly.
13
+ env:
14
+ UV_LOCKED: "1"
15
+
16
+ # A newer run on a pull request cancels the older one. A push to main has a group of its own, so every commit there is
17
+ # checked.
18
+ concurrency:
19
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
20
+ cancel-in-progress: true
21
+
22
+ jobs:
23
+ lint:
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 10
26
+ steps:
27
+ - name: Check out repository
28
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29
+ with:
30
+ persist-credentials: false
31
+
32
+ - name: Set up uv and Python 3.12
33
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
34
+ with:
35
+ python-version: "3.12"
36
+ enable-cache: true
37
+
38
+ - name: Install dependencies
39
+ run: uv sync --locked
40
+
41
+ # Every formatter's check, every linter, the type checker, and brash on its own code.
42
+ - name: Lint
43
+ run: make lint
44
+
45
+ test:
46
+ runs-on: ubuntu-latest
47
+ timeout-minutes: 10
48
+ strategy:
49
+ fail-fast: false
50
+ matrix:
51
+ python: ["3.12", "3.13", "3.14"]
52
+ steps:
53
+ - name: Check out repository
54
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
55
+ with:
56
+ persist-credentials: false
57
+
58
+ - name: Set up uv and Python ${{ matrix.python }}
59
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
60
+ with:
61
+ python-version: ${{ matrix.python }}
62
+ enable-cache: true
63
+
64
+ - name: Install dependencies
65
+ run: uv sync --locked
66
+
67
+ - name: Test
68
+ run: make test
@@ -0,0 +1,84 @@
1
+ name: Publish
2
+
3
+ # Pushing a `v*` tag is the whole release step: this builds the tag's wheel and sdist, whose version is the tag's
4
+ # (pyproject.toml), and publishes them to PyPI. It holds no token: PyPI trusts this workflow, run from the `pypi`
5
+ # environment of this repository, by OpenID Connect (https://docs.pypi.org/trusted-publishers/), so the trusted
6
+ # publisher on PyPI must name this file and that environment.
7
+ #
8
+ # The Tag workflow starts this one by `workflow_dispatch` on the tag it created, since a tag pushed with a workflow's
9
+ # own token sends no push event. Started by hand on a branch, the build fails at the version check and nothing is
10
+ # published.
11
+ on:
12
+ push:
13
+ tags: ["v*"]
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.ref_name }}
21
+
22
+ jobs:
23
+ # Without the permission to publish, so nothing the build or the tests run can.
24
+ build:
25
+ runs-on: ubuntu-latest
26
+ timeout-minutes: 10
27
+ steps:
28
+ # Every tag, since the version is read from them.
29
+ - name: Check out the tag
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ persist-credentials: false
33
+ fetch-depth: 0
34
+
35
+ # No cache: a release restores nothing a run on another ref could have written.
36
+ - name: Set up uv and Python 3.12
37
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
38
+ with:
39
+ python-version: "3.12"
40
+ enable-cache: false
41
+
42
+ - name: Install dependencies
43
+ run: uv sync --locked
44
+
45
+ - name: Lint and test
46
+ run: make check
47
+
48
+ - name: Build the wheel and the sdist
49
+ run: uv build
50
+
51
+ # A tag that is not a version git can be counted from (v1, vNext) would build as some other version.
52
+ - name: Check that the version built is the tag's
53
+ run: |
54
+ version=${GITHUB_REF_NAME#v}
55
+ ls dist
56
+ test -f "dist/brash-$version-py3-none-any.whl"
57
+ test -f "dist/brash-$version.tar.gz"
58
+
59
+ - name: Keep the distributions for the publish job
60
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
61
+ with:
62
+ name: dist
63
+ path: dist/
64
+ if-no-files-found: error
65
+
66
+ publish:
67
+ needs: build
68
+ runs-on: ubuntu-latest
69
+ timeout-minutes: 10
70
+ environment:
71
+ name: pypi
72
+ url: https://pypi.org/project/brash/
73
+ permissions:
74
+ # The OpenID Connect token PyPI exchanges for a short-lived upload token: the whole of the trusted publishing.
75
+ id-token: write
76
+ steps:
77
+ - name: Collect the distributions
78
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
79
+ with:
80
+ name: dist
81
+ path: dist/
82
+
83
+ - name: Publish to PyPI
84
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
@@ -0,0 +1,90 @@
1
+ name: Tag
2
+
3
+ # Run by hand, this tags the head of a branch as the next release and starts the Publish workflow on the tag. The
4
+ # next version is the highest `vMAJOR.MINOR.PATCH` tag with one part raised, 0.0.0 where there is none yet, or the
5
+ # exact tag typed in.
6
+ on:
7
+ workflow_dispatch:
8
+ inputs:
9
+ bump:
10
+ description: The part of the highest version tag to raise
11
+ type: choice
12
+ options: [patch, minor, major]
13
+ default: patch
14
+ tag:
15
+ description: An exact tag to create in place of the bump, such as v1.0.0rc1
16
+ type: string
17
+ branch:
18
+ description: The branch whose head is tagged
19
+ type: string
20
+ default: main
21
+
22
+ permissions: {}
23
+
24
+ # One at a time, so two runs cannot both read the same highest tag.
25
+ concurrency:
26
+ group: ${{ github.workflow }}
27
+
28
+ jobs:
29
+ tag:
30
+ runs-on: ubuntu-latest
31
+ timeout-minutes: 10
32
+ permissions:
33
+ # To create the tag.
34
+ contents: write
35
+ # To start the Publish workflow: a tag this workflow's token creates sends no push event to start it.
36
+ actions: write
37
+ env:
38
+ GH_TOKEN: ${{ github.token }}
39
+ steps:
40
+ # Every tag, to find the highest. The tag is created through the API, so git keeps no credentials.
41
+ - name: Check out the branch
42
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43
+ with:
44
+ ref: ${{ inputs.branch }}
45
+ persist-credentials: false
46
+ fetch-depth: 0
47
+
48
+ - name: Choose the tag
49
+ id: choose
50
+ env:
51
+ BUMP: ${{ inputs.bump }}
52
+ TAG: ${{ inputs.tag }}
53
+ run: |
54
+ if [[ -n $TAG ]]; then
55
+ tag=$TAG
56
+ if [[ ! $tag =~ ^v[0-9] ]] || ! git check-ref-format "refs/tags/$tag"; then
57
+ echo "::error::'$tag' is not a tag like v1.2.3"
58
+ exit 1
59
+ fi
60
+ else
61
+ latest=$(git tag --list 'v*' --sort=-version:refname | grep -E -m 1 '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
62
+ IFS=. read -r major minor patch <<< "${latest:-v0.0.0}"
63
+ major=${major#v}
64
+ case $BUMP in
65
+ major) tag="v$((major + 1)).0.0" ;;
66
+ minor) tag="v$major.$((minor + 1)).0" ;;
67
+ patch) tag="v$major.$minor.$((patch + 1))" ;;
68
+ *) echo "::error::'$BUMP' is not major, minor or patch"; exit 1 ;;
69
+ esac
70
+ echo "The highest version tag is ${latest:-not there yet}."
71
+ fi
72
+ if git rev-parse --quiet --verify "refs/tags/$tag" > /dev/null; then
73
+ echo "::error::The tag $tag already exists"
74
+ exit 1
75
+ fi
76
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
77
+
78
+ - name: Create the tag
79
+ env:
80
+ TAG: ${{ steps.choose.outputs.tag }}
81
+ BRANCH: ${{ inputs.branch }}
82
+ run: |
83
+ sha=$(git rev-parse HEAD)
84
+ gh api "repos/$GITHUB_REPOSITORY/git/refs" -f "ref=refs/tags/$TAG" -f "sha=$sha" --silent
85
+ echo "Tagged \`$sha\`, the head of \`$BRANCH\`, as \`$TAG\`." >> "$GITHUB_STEP_SUMMARY"
86
+
87
+ - name: Start the Publish workflow on the tag
88
+ env:
89
+ TAG: ${{ steps.choose.outputs.tag }}
90
+ run: gh workflow run publish.yml --ref "$TAG"
brash-0.1.0/.gitignore ADDED
@@ -0,0 +1,223 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # uv
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Conda environments
163
+ conda-meta/
164
+
165
+ # Spyder project settings
166
+ .spyderproject
167
+ .spyproject
168
+
169
+ # Rope project settings
170
+ .ropeproject
171
+
172
+ # mkdocs/Zensical documentation
173
+ /site
174
+
175
+ # mypy
176
+ .mypy_cache/
177
+ .dmypy.json
178
+ dmypy.json
179
+
180
+ # Pyre type checker
181
+ .pyre/
182
+
183
+ # pytype static type analyzer
184
+ .pytype/
185
+
186
+ # Cython debug symbols
187
+ cython_debug/
188
+
189
+ # PyCharm
190
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
191
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
192
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
193
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
194
+ # .idea/
195
+
196
+ # Abstra
197
+ # Abstra is an AI-powered process automation framework.
198
+ # Ignore directories containing user credentials, local state, and settings.
199
+ # Learn more at https://abstra.io/docs
200
+ .abstra/
201
+
202
+ # Visual Studio Code
203
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
204
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
205
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
206
+ # could uncomment the following to ignore the entire vscode folder
207
+ # .vscode/
208
+ # Temporary file for partial code execution
209
+ tempCodeRunnerFile.py
210
+
211
+ # Ruff stuff:
212
+ .ruff_cache/
213
+
214
+ # PyPI configuration file
215
+ .pypirc
216
+
217
+ # Marimo
218
+ marimo/_static/
219
+ marimo/_lsp/
220
+ __marimo__/
221
+
222
+ # Streamlit
223
+ .streamlit/secrets.toml
@@ -0,0 +1,2 @@
1
+ # Automatically created by rumdl.
2
+ *
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "5d27b7ebe2be4e0e6cedad0d85f31c03489ad3d68ef1ef6e0f8180dd83e05307",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/tests/cases/type-aliases.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "766e68abccd6c83a22cde956012fad071c8fafe621f9e1645c693aa1f392d34d",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/AGENTS.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "7b72c0eaef6acef4f6f2b4ef894ac332371bb352f1cb51c8cc1a9ce595ae69c8",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/README.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "85491b8330474cf7b3e4688c23b45ab0e6804426ccca401f245b6a4fe8790402",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/tests/cases/final-constants.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "8733af4ba38c46a600729619ef69733590be2ada489b0d2c27b99e3ddeb9098a",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/tests/cases/general-params.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "d846fe9fb4bcf1fed1aa1ece46b9501de4671f14f0a51131c6f912b353e71080",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/tests/cases/doc-comments.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "file_hash": "eb5f48bc10e0c22ebc0d90b72401142f812ff998d8107c18dc572adc562fde08",
3
+ "config_hash": "603c1dcf18823e40ef12160e4f19720dd6b0d0f33a806e6dfe95ba31db3e8215",
4
+ "rules_hash": "099a0c69894aedfcace82cd8e665a79ec62256e68309e7db8d3aca3b5ba3e333",
5
+ "version": "0.3.5",
6
+ "warnings": [],
7
+ "source_path": "/home/runner/work/brash/brash/CLAUDE.md",
8
+ "dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
9
+ "timestamp": 1795149501
10
+ }
@@ -0,0 +1,2 @@
1
+ Signature: 8a477f597d28d172789f06886806bc55
2
+ # This file is a cache directory tag created by rumdl.
brash-0.1.0/AGENTS.md ADDED
@@ -0,0 +1,78 @@
1
+ # AGENTS.md
2
+
3
+ Instructions for any agent working in this repository. Humans should read it too.
4
+
5
+ brash is a command line that rewrites Python with codemods, and checks that none has anything left to rewrite. Read
6
+ `README.md` first: what each codemod does, how a project registers its own, and how to add one here.
7
+
8
+ ## How to work
9
+
10
+ - Small PRs. One concern per PR. Conventional commit messages.
11
+ - A codemod's behaviour is its cases: a change to what one rewrites or leaves alone changes `tests/cases/<name>.md`
12
+ and its paragraph in `README.md` in the same PR.
13
+ - brash is a published library. A change to what other projects rely on (the command's flags and exit codes,
14
+ `[tool.brash]`, `brash.command.Command`, `brash.run.rewrite`) says so in its PR.
15
+ - A codemod here reads nothing but the module it rewrites, so it works in any project. One that reads a project's
16
+ own files is that project's, registered in its `pyproject.toml`.
17
+ - When unsure, prefer the smaller change and leave a note in the PR. Do not invent requirements.
18
+
19
+ ## Toolchain
20
+
21
+ - Python 3.12+. Package layout `src/brash/`. CLI entry point `brash`.
22
+ - `uv` for everything: `uv sync`, `uv run`. `hatchling` builds it, and the version comes from the latest `v*` tag.
23
+ - Runtime dependencies are `click`, for the command line (never argparse), and `libcst`. Adding a third makes every
24
+ project that installs brash install it too: do it only when the stdlib makes the code materially worse, and say why
25
+ in the PR. A dev-only tool gets a comment where it is configured saying what it is for.
26
+ - `make fmt`, then `make lint` and `make test`, before pushing: all three take seconds. `make check` is lint and test,
27
+ and never rewrites files. CI runs the lint, and the tests under each supported Python.
28
+ - `make fmt` runs brash on its own code first, then ruff (imports, trailing commas, format) and rumdl. `make lint`
29
+ fails with the diff where a codemod would still change a file.
30
+ - ruff selects every stable rule, and preview rules named one by one. Opt out with a commented `ignore` entry or a
31
+ `noqa` with a code; never narrow `select`. `pyrefly` type-checks in strict mode. `pytest` runs in strict mode,
32
+ where a warning fails the test that raised it. `rumdl` lints and formats Markdown; `actionlint` and `zizmor` lint
33
+ the workflows, where every action is pinned to a commit.
34
+
35
+ ## Formatting
36
+
37
+ Maximum line length is 120 characters, for every file type: Python (ruff), Markdown (rumdl), and the rest
38
+ (`.editorconfig`). Do not reflow existing text to fill 120 columns; wrap new or edited prose at 120. The exceptions
39
+ are lines that cannot be broken: long URLs, Markdown tables and code blocks.
40
+
41
+ ## Code conventions
42
+
43
+ These are the conventions brash's codemods apply, and a few they cannot.
44
+
45
+ - Fully typed, `pyrefly` strict clean, the tests included.
46
+ - A public module, class, or function has a Google docstring, with Returns, Yields, and Raises sections that match
47
+ its body. Every docstring opens with a one-line summary ending in a period.
48
+ - A parameter takes the most general type its body needs (`Iterable`, `Collection`, `Sequence`, `Mapping`,
49
+ `AbstractSet`); a return keeps the concrete type it builds. `general-params` widens what it can prove.
50
+ - A module constant is `UPPER_CASE` and `Final` (`final-constants`); a type alias is a `type` statement
51
+ (`type-aliases`).
52
+ - A comment that says what a constant, a type alias, a dataclass or `NamedTuple` field, or an enum member is, is a
53
+ `#:` doc comment directly above it (`doc-comments`). A note on why the code is so stays a plain `#`, with a blank
54
+ line below it or beside the value.
55
+ - A frozen dataclass holds no mutable collection type.
56
+ - Modules are in newspaper order: the docstring, what Python needs at import time, the public names, most important
57
+ first, then the private helpers, each below the first function that calls it.
58
+ - No global mutable state.
59
+ - A codemod decides from the module's text and syntax alone: it never imports or runs the code it rewrites.
60
+
61
+ ## Testing
62
+
63
+ - A codemod's cases are Python snippets in `tests/cases/<name>.md`, read by `tests/helpers.py`: two `python` blocks
64
+ under a `###` heading are before and after, one is text it must leave alone. A new case goes there, not in an
65
+ escaped string in a test module.
66
+ - Every codemod leaves alone what it wrote: its test runs each case's output through it again, and `wants` says no
67
+ to it.
68
+ - Patch with `unittest.mock`, as context managers, never pytest's `monkeypatch`; a mock is specced. Import the
69
+ namespace: `from unittest import mock`.
70
+ - Every test directory has an `__init__.py`, so the tests import `tests.helpers`. A test module imports from no
71
+ other test module.
72
+ - A test waits on a condition, never on time.
73
+
74
+ ## Definition of done for a PR
75
+
76
+ - `make lint` and `make test` pass, and CI passes.
77
+ - New behavior has a test.
78
+ - `README.md` describes what changed, where it describes that part.
brash-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ @AGENTS.md