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/.github/workflows/release.yml b/.github/workflows/release.yml index 31bec70..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) != 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 + cog --config .config/cog.toml bump --auto - name: Create GitHub release if: steps.check_changes.outputs.has_changes == 'true' 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/justfile b/justfile index e747c1b..09aebb7 100644 --- a/justfile +++ b/justfile @@ -27,7 +27,8 @@ 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/rumdl.toml template/.config/ mkdir -p template/tools cp tools/get-contributors.sh template/tools/ cp .github/pull_request_template.md template/.github/ 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/.typos.toml index fa5f9dc..b169af3 100644 --- a/template/.typos.toml +++ b/template/.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 e89bec0..b82679a 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -35,6 +35,8 @@ "python.testing.pytestEnabled": true, "python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest", "mypy.runUsingActiveInterpreter": true, + "ruff.configuration": ".config/ruff.toml", + "mypy.configFile": ".config/mypy.ini", "conventionalCommits.emojiFormat": "emoji", "conventionalCommits.promptScopes": false } 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 f64b69b..6b9c91c 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 - uvx ruff check . + uvx 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: - uvx ruff check --fix . - uvx ruff format . + uvx ruff check --fix . --config .config/ruff.toml + uvx ruff format . --config .config/ruff.toml # Format Markdown files format-md: diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index b0a0b9d..f975cc4 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -47,3 +47,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