Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
coverage: /TOTAL.*? (100(?:\.0+)?\%\|[1-9]?\d(?:\.\d+)?\%)$/
image: ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}
interruptible: true
parallel:
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ repos:
language: python
types:
- text
- id: check-jsonschema
name: check-jsonschema
entry: make check-jsonschema
language: python
files: (?x)^(
\.github/workflows/[^/]+|
\.gitlab-ci\.yml|
\.gitlab/workflows/[^/]+|
\.readthedocs\.yaml|
\.renovaterc\.json
)$
pass_filenames: false
- id: forbidden-files
name: forbidden files
entry: found Copier update rejection files; review them and remove them
Expand Down
2 changes: 1 addition & 1 deletion .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
],
"postUpgradeTasks": {
"commands": [
"find template -type f -regex 'template/.*\.github.*/workflows/.*' -exec sed -i 's|{{{depName}}}-{{{currentValue}}}|{{{depName}}}-{{{newValue}}}|g' {} +"
"find template -type f -regex 'template/.*\\.github.*/workflows/.*' -exec sed -i 's|{{{depName}}}-{{{currentValue}}}|{{{depName}}}-{{{newValue}}}|g' {} +"
]
}
},
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dev:

# Install standalone tools
prerequisites:
pipx install --force check-jsonschema==0.29.4
pipx install --force codespell[toml]==2.3.0
pipx install --force pdm==2.20.1
pipx install --force pre-commit==4.0.1
Expand Down Expand Up @@ -87,8 +88,15 @@ pyproject-fmt:
codespell:
codespell

# Check jsonschema with check-jsonschema.
check-jsonschema:
check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yml
check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci .gitlab-ci.yml .gitlab/workflows/*.yml
check-jsonschema --builtin-schema vendor.readthedocs .readthedocs.yaml
check-jsonschema --builtin-schema vendor.renovate .renovaterc.json

# Check lint with all linters.
lint: mypy ruff ruff-format pyproject-fmt codespell
lint: mypy ruff ruff-format pyproject-fmt codespell check-jsonschema

# Run pre-commit with autofix against all files.
pre-commit:
Expand Down
12 changes: 12 additions & 0 deletions template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ repos:
language: python
types:
- text
- id: check-jsonschema
name: check-jsonschema
entry: make check-jsonschema
language: python
files: (?x)^(
\.github/workflows/[^/]+|
\.gitlab-ci\.yml|
\.gitlab/workflows/[^/]+|
\.readthedocs\.yaml|
\.renovaterc\.json
)$
pass_filenames: false
- id: forbidden-files
name: forbidden files
entry: found Copier update rejection files; review them and remove them
Expand Down
2 changes: 1 addition & 1 deletion template/.renovaterc.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
],
"postUpgradeTasks": {
"commands": [
"find template -type f -regex 'template/.*\.github.*/workflows/.*' -exec sed -i {{ '\'s|{{{depName}}}-{{{currentValue}}}|{{{depName}}}-{{{newValue}}}|g\' {} +' }}"
"find template -type f -regex 'template/.*\\.github.*/workflows/.*' -exec sed -i {{ '\'s|{{{depName}}}-{{{currentValue}}}|{{{depName}}}-{{{newValue}}}|g\' {} +' }}"
]
}
},
Expand Down
14 changes: 13 additions & 1 deletion template/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ dev:

# Install standalone tools
prerequisites:
pipx install --force check-jsonschema==0.29.4
pipx install --force codespell[toml]==2.3.0
pipx install --force pdm==2.20.1
pipx install --force pre-commit==4.0.1
Expand Down Expand Up @@ -89,8 +90,19 @@ pyproject-fmt:
codespell:
codespell

# Check jsonschema with check-jsonschema.
check-jsonschema:
[%- if repo_platform == "github" %]
check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yml
[%- endif %]
[%- if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == "Serious Scaffold Python" %]
check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci .gitlab-ci.yml .gitlab/workflows/*.yml
[%- endif %]
check-jsonschema --builtin-schema vendor.readthedocs .readthedocs.yaml
check-jsonschema --builtin-schema vendor.renovate .renovaterc.json

# Check lint with all linters.
lint: mypy ruff ruff-format pyproject-fmt codespell
lint: mypy ruff ruff-format pyproject-fmt codespell check-jsonschema

# Run pre-commit with autofix against all files.
pre-commit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ci:
files:
- pdm.lock
prefix: venv-${PYTHON_VERSION}
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
coverage: /TOTAL.*? (100(?:\.0+)?\%\|[1-9]?\d(?:\.\d+)?\%)$/
image: ${CI_REGISTRY_IMAGE}/dev:py${PYTHON_VERSION}
interruptible: true
parallel:
Expand Down