Skip to content

Commit 23ece6f

Browse files
dguidoclaude
andcommitted
Add stricter configuration defaults
- Bump minimum Python to 3.11, remove 3.10 from CI matrix - Add security pre-commit hooks: shellcheck, actionlint, zizmor - Add ruff src path and docstring-code-format settings - Enable branch coverage with standard exclude patterns - Add pip-audit dependency group for vulnerability scanning Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bd28e6c commit 23ece6f

3 files changed

Lines changed: 35 additions & 4 deletions

File tree

{{cookiecutter.project_slug}}/.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
strategy:
1414
matrix:
1515
python:
16-
- "3.10"
1716
- "3.11"
1817
- "3.12"
1918
- "3.13"

{{cookiecutter.project_slug}}/.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ repos:
1010
- id: check-merge-conflict
1111
- id: detect-private-key
1212

13+
# Shell script linting
14+
- repo: https://github.com/koalaman/shellcheck-precommit
15+
rev: v0.11.0
16+
hooks:
17+
- id: shellcheck
18+
args: [--severity=error]
19+
20+
# GitHub Actions linting
21+
- repo: https://github.com/rhysd/actionlint
22+
rev: v1.7.10
23+
hooks:
24+
- id: actionlint
25+
26+
# GitHub Actions security audit
27+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
28+
rev: v1.22.0
29+
hooks:
30+
- id: zizmor
31+
args: [--persona=regular, --min-severity=medium, --min-confidence=medium]
32+
1333
- repo: local
1434
hooks:
1535
- id: format

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
"Programming Language :: Python :: 3",
2020
]
2121
dependencies = []
22-
requires-python = ">=3.10"
22+
requires-python = ">=3.11"
2323

2424
[build-system]
2525
requires = ["uv_build>=0.9.0,<0.10.0"]
@@ -41,10 +41,12 @@ lint = [
4141
"interrogate",
4242
{%- endif %}
4343
]
44+
audit = ["pip-audit"]
4445
dev = [
4546
{include-group = "doc"},
4647
{include-group = "test"},
4748
{include-group = "lint"},
49+
{include-group = "audit"},
4850
"prek",
4951
]
5052

@@ -60,25 +62,35 @@ Issues = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.
6062
Source = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}"
6163

6264
[tool.coverage.run]
65+
branch = true
6366
# don't attempt code coverage for the CLI entrypoints
6467
omit = ["{{ cookiecutter.__project_src_path }}/_cli.py"]
6568

69+
[tool.coverage.report]
70+
exclude_lines = [
71+
"pragma: no cover",
72+
"if TYPE_CHECKING:",
73+
"if __name__ == .__main__.:",
74+
]
75+
6676
[tool.ty.terminal]
6777
error-on-warning = true
6878

6979
[tool.ty.environment]
70-
python-version = "3.10"
80+
python-version = "3.11"
7181

7282
[tool.ty.src]
7383
include = ["src", "test"]
7484

7585
[tool.ruff]
7686
line-length = 100
77-
target-version = "py310"
87+
target-version = "py311"
88+
src = ["src"]
7889

7990
[tool.ruff.format]
8091
line-ending = "lf"
8192
quote-style = "double"
93+
docstring-code-format = true
8294

8395
[tool.ruff.lint]
8496
select = ["ALL"]

0 commit comments

Comments
 (0)