From 8aa704410bc746ff46c23d08715cac831681c6b1 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Wed, 20 May 2026 14:59:48 +0200 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=F0=9F=9A=9A=20move=20config=20?= =?UTF-8?q?files=20into=20`.config/`=20or=20`pyproject.toml`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cog.toml => .config/cog.toml | 0 .rumdl.toml => .config/rumdl.toml | 0 .typos.toml => .config/typos.toml | 0 .github/workflows/release.yml | 4 ++-- .vscode/settings.json | 3 ++- justfile | 5 +++-- template/{ => .config}/mypy.ini | 0 template/{_renderer.py => .config/quartodoc.py} | 0 template/{ => .config}/ruff.toml | 0 template/{.rumdl.toml => .config/rumdl.toml} | 12 ++++++------ template/{.typos.toml => .config/typos.toml} | 4 ++++ template/.vscode/settings.json | 3 +++ template/_quarto.yml.jinja | 2 +- template/justfile.jinja | 10 +++++----- template/pyproject.toml.jinja | 9 +++++++++ template/pytest.ini | 8 -------- 16 files changed, 35 insertions(+), 25 deletions(-) rename cog.toml => .config/cog.toml (100%) rename .rumdl.toml => .config/rumdl.toml (100%) rename .typos.toml => .config/typos.toml (100%) rename template/{ => .config}/mypy.ini (100%) rename template/{_renderer.py => .config/quartodoc.py} (100%) rename template/{ => .config}/ruff.toml (100%) rename template/{.rumdl.toml => .config/rumdl.toml} (67%) rename template/{.typos.toml => .config/typos.toml} (68%) delete mode 100644 template/pytest.ini diff --git a/cog.toml b/.config/cog.toml similarity index 100% rename from cog.toml rename to .config/cog.toml diff --git a/.rumdl.toml b/.config/rumdl.toml similarity index 100% rename from .rumdl.toml rename to .config/rumdl.toml diff --git a/.typos.toml b/.config/typos.toml similarity index 100% rename from .typos.toml rename to .config/typos.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31bec70..c0089bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: id: check_changes run: | # Determine if a bump is possible. - if [[ $(cog bump --auto --dry-run) != No* ]]; then + if [[ $(cog bump --auto --dry-run --config .config/cog.toml) != No* ]]; then echo "has_changes=true" >> $GITHUB_OUTPUT else echo "has_changes=false" >> $GITHUB_OUTPUT @@ -76,7 +76,7 @@ jobs: - name: Create tag and update changelog if: steps.check_changes.outputs.has_changes == 'true' run: | - cog bump --auto + cog bump --auto --config .config/cog.toml - name: Create GitHub release if: steps.check_changes.outputs.has_changes == 'true' diff --git a/.vscode/settings.json b/.vscode/settings.json index 744ecbb..b2e95b0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,5 +27,6 @@ }, "files.insertFinalNewline": true, "conventionalCommits.emojiFormat": "emoji", - "conventionalCommits.promptScopes": false + "conventionalCommits.promptScopes": false, + "typos.config": ".config/typos.toml" } diff --git a/justfile b/justfile index e747c1b..47351eb 100644 --- a/justfile +++ b/justfile @@ -27,14 +27,15 @@ update-quarto-theme: # Update files in the template from the Copier parent folder sync-template-files: - cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig .rumdl.toml template/ + cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig template/ + cp .config/* template/.config/ mkdir -p template/tools cp tools/get-contributors.sh template/tools/ cp .github/pull_request_template.md template/.github/ # Check for spelling errors in files check-spelling: - uvx typos + uvx typos --config .config/typos.toml # Check that URLs work check-urls: diff --git a/template/mypy.ini b/template/.config/mypy.ini similarity index 100% rename from template/mypy.ini rename to template/.config/mypy.ini diff --git a/template/_renderer.py b/template/.config/quartodoc.py similarity index 100% rename from template/_renderer.py rename to template/.config/quartodoc.py diff --git a/template/ruff.toml b/template/.config/ruff.toml similarity index 100% rename from template/ruff.toml rename to template/.config/ruff.toml diff --git a/template/.rumdl.toml b/template/.config/rumdl.toml similarity index 67% rename from template/.rumdl.toml rename to template/.config/rumdl.toml index 68a1b6c..ba9b523 100644 --- a/template/.rumdl.toml +++ b/template/.config/rumdl.toml @@ -3,12 +3,12 @@ line_length = 72 flavor = "quarto" exclude = [ - # Common directories to exclude - ".github", - # This is auto-generated from the qmd version - "**/README.md", - # This has it's own structure - "**/LICENSE.md" + # Common directories to exclude + ".github", + # This is auto-generated from the qmd version + "**/README.md", + # This has it's own structure + "**/LICENSE.md", ] # List style: `-` diff --git a/template/.typos.toml b/template/.config/typos.toml similarity index 68% rename from template/.typos.toml rename to template/.config/typos.toml index fa5f9dc..b169af3 100644 --- a/template/.typos.toml +++ b/template/.config/typos.toml @@ -1,5 +1,6 @@ [files] extend-exclude = [ + "*.html", "*.json", "*.css", ".quarto/*", @@ -7,4 +8,7 @@ extend-exclude = [ "_extensions/*", ".coverage-report/*", "site_libs/", + "*.svg", + # Since it has hashes + "CHANGELOG.md", ] diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json index e9f9b18..3398936 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -35,4 +35,7 @@ "python.testing.pytestEnabled": true, "python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest", "mypy.runUsingActiveInterpreter": true, + "typos.config": ".config/typos.toml", + "ruff.configuration": ".config/ruff.toml", + "mypy.configFile": ".config/mypy.ini" } diff --git a/template/_quarto.yml.jinja b/template/_quarto.yml.jinja index f4f5dbb..15601a5 100644 --- a/template/_quarto.yml.jinja +++ b/template/_quarto.yml.jinja @@ -67,7 +67,7 @@ quartodoc: parser: google dynamic: true renderer: - style: _renderer.py + style: .config/quartodoc.py table_style: description-list show_signature_annotations: true diff --git a/template/justfile.jinja b/template/justfile.jinja index efe61a4..2e5b6ad 100644 --- a/template/justfile.jinja +++ b/template/justfile.jinja @@ -54,14 +54,14 @@ test-python: # Check Python code for any errors that need manual attention check-python: # Check formatting - uv run ruff check . + uv run ruff check . --config .config/ruff.toml # Check types - uv run mypy --pretty . + uv run mypy --pretty . --config-file .config/mypy.ini # Reformat Python code to match coding style and general structure format-python: - uv run ruff check --fix . - uv run ruff format . + uv run ruff check --fix . --config .config/ruff.toml + uv run ruff format . --config .config/ruff.toml # Format Markdown files format-md: @@ -103,7 +103,7 @@ check-security: # Check for spelling errors in files check-spelling: - uv run typos + uv run typos --config .config/typos.toml # Install lychee from https://lychee.cli.rs/guides/getting-started/ # Check that URLs work diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 1f8a98f..0d47a23 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -27,3 +27,12 @@ issues = "https://github.com/{{ github_repo_spec }}/issues" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" + +[tool.pytest.ini_options] +# - A short traceback (tb) mode to make it easier to view +# - Use the `src/` package (importlib) +# - Use code coverage on the `src/` package +# - If tests fail, do not generate coverage report +# - Create the coverage report in XML (for badge), terminal, and HTML +# - Trigger failure if below 90% code coverage +addopts = "--tb=short --import-mode=importlib --cov=src --no-cov-on-fail --cov-report=term --cov-report=xml --cov-report=html --cov-fail-under=90" diff --git a/template/pytest.ini b/template/pytest.ini deleted file mode 100644 index 5b84f15..0000000 --- a/template/pytest.ini +++ /dev/null @@ -1,8 +0,0 @@ -[pytest] -# - A short traceback (tb) mode to make it easier to view -# - Use the `src/` package (importlib) -# - Use code coverage on the `src/` package -# - If tests fail, do not generate coverage report -# - Create the coverage report in XML (for badge), terminal, and HTML -# - Trigger failure if below 90% code coverage -addopts = --tb=short --import-mode=importlib --cov=src --no-cov-on-fail --cov-report=term --cov-report=xml --cov-report=html --cov-fail-under=90 From a79c29170c3b209ea5f41f11efb80b951680f974 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Thu, 21 May 2026 21:00:09 +0200 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=F0=9F=9A=9A=20moved=20`.typos.?= =?UTF-8?q?toml`=20back=20from=20`.config/`,=20didn't=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- .config/typos.toml => .typos.toml | 0 .vscode/settings.json | 3 +-- justfile | 4 ++-- template/{.config/typos.toml => .typos.toml} | 0 template/.vscode/settings.json | 1 - template/justfile.jinja | 2 +- 7 files changed, 5 insertions(+), 7 deletions(-) rename .config/typos.toml => .typos.toml (100%) rename template/{.config/typos.toml => .typos.toml} (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e55ae5..ff33908 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,6 @@ repos: - id: typos - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.1.94 + rev: v0.1.96 hooks: - id: rumdl-fmt # Auto-format diff --git a/.config/typos.toml b/.typos.toml similarity index 100% rename from .config/typos.toml rename to .typos.toml diff --git a/.vscode/settings.json b/.vscode/settings.json index b2e95b0..744ecbb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,6 +27,5 @@ }, "files.insertFinalNewline": true, "conventionalCommits.emojiFormat": "emoji", - "conventionalCommits.promptScopes": false, - "typos.config": ".config/typos.toml" + "conventionalCommits.promptScopes": false } diff --git a/justfile b/justfile index 47351eb..09aebb7 100644 --- a/justfile +++ b/justfile @@ -28,14 +28,14 @@ update-quarto-theme: # Update files in the template from the Copier parent folder sync-template-files: cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig template/ - cp .config/* template/.config/ + cp .config/rumdl.toml template/.config/ mkdir -p template/tools cp tools/get-contributors.sh template/tools/ cp .github/pull_request_template.md template/.github/ # Check for spelling errors in files check-spelling: - uvx typos --config .config/typos.toml + uvx typos # Check that URLs work check-urls: diff --git a/template/.config/typos.toml b/template/.typos.toml similarity index 100% rename from template/.config/typos.toml rename to template/.typos.toml diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json index 3398936..7876712 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -35,7 +35,6 @@ "python.testing.pytestEnabled": true, "python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest", "mypy.runUsingActiveInterpreter": true, - "typos.config": ".config/typos.toml", "ruff.configuration": ".config/ruff.toml", "mypy.configFile": ".config/mypy.ini" } diff --git a/template/justfile.jinja b/template/justfile.jinja index 2e5b6ad..56f898b 100644 --- a/template/justfile.jinja +++ b/template/justfile.jinja @@ -103,7 +103,7 @@ check-security: # Check for spelling errors in files check-spelling: - uv run typos --config .config/typos.toml + uv run typos # Install lychee from https://lychee.cli.rs/guides/getting-started/ # Check that URLs work From e4d4c059456ee1caa4e900ab96284a8dbd349427 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Thu, 21 May 2026 22:09:24 +0200 Subject: [PATCH 3/3] ci: oops, `--config` needs to be before `bump` Co-authored-by: Luke W. Johnston --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0089bb..9eebcdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: id: check_changes run: | # Determine if a bump is possible. - if [[ $(cog bump --auto --dry-run --config .config/cog.toml) != No* ]]; then + if [[ $(cog --config .config/cog.toml bump --auto --dry-run) != No* ]]; then echo "has_changes=true" >> $GITHUB_OUTPUT else echo "has_changes=false" >> $GITHUB_OUTPUT @@ -76,7 +76,7 @@ jobs: - name: Create tag and update changelog if: steps.check_changes.outputs.has_changes == 'true' run: | - cog bump --auto --config .config/cog.toml + cog --config .config/cog.toml bump --auto - name: Create GitHub release if: steps.check_changes.outputs.has_changes == 'true'