Skip to content

Commit 8a5daf8

Browse files
authored
Add codespell to the template itself (#108)
* Add codespell to the template itself * Fix test typo * simplify pyproject entry * Test codespell pyproject entry
1 parent 1b2247a commit 8a5daf8

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

tests/test_cookiecutter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def create_test_configs(create_docs):
3838
"{{cookiecutter.github_username_or_organization}}/"
3939
"{{cookiecutter.package_name}}",
4040
"module_name": "test_cookiecutter_module",
41-
"short_description": "Lets Test CookierCutter",
41+
"short_description": "Lets Test CookieCutter",
4242
"license": "MIT",
4343
"create_docs": "yes" if create_docs else "no",
4444
},
@@ -225,7 +225,7 @@ def test_pyproject_toml(package_path_config_dict):
225225
assert (
226226
project_toml["project"]["authors"][0]["email"] == config_dict["email"]
227227
)
228-
assert project_toml["project"]["description"] == "Lets Test CookierCutter"
228+
assert project_toml["project"]["description"] == "Lets Test CookieCutter"
229229
assert project_toml["project"]["readme"] == "README.md"
230230
assert project_toml["project"]["requires-python"] == ">=3.9.0"
231231
assert (
@@ -299,6 +299,9 @@ def test_pyproject_toml(package_path_config_dict):
299299

300300
assert "legacy_tox_ini" in project_toml["tool"]["tox"]
301301

302+
assert project_toml["tool"]["codespell"]["skip"] == ".git"
303+
assert project_toml["tool"]["codespell"]["check-hidden"] is True
304+
302305

303306
def test_pip_install(pip_install):
304307
config_dict = pip_install
@@ -314,7 +317,7 @@ def test_pip_install(pip_install):
314317
show_details = stdout.decode("utf8")
315318
assert "Name: test-cookiecutter" in show_details
316319
assert "Version: 0.1.dev0" in show_details
317-
assert "Summary: Lets Test CookierCutter" in show_details
320+
assert "Summary: Lets Test CookieCutter" in show_details
318321
assert (
319322
"Author-email: Test Cookiecutter <testing@cookiecutter.com>"
320323
in show_details

{{cookiecutter.package_name}}/.github/workflows/docs_build_and_deploy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ on:
1414
pull_request:
1515
workflow_dispatch:
1616

17+
1718
jobs:
19+
linting:
20+
# scheduled workflows should not run on forks
21+
if: (${{ github.event_name == 'schedule' }} && ${{ github.repository_owner == 'neuroinformatics-unit' }} && ${{ github.ref == 'refs/heads/main' }}) || (${{ github.event_name != 'schedule' }})
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: neuroinformatics-unit/actions/lint@v2
25+
1826
build_sphinx_docs:
1927
name: Build Sphinx Docs
2028
runs-on: ubuntu-latest

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ repos:
3939
- id: check-manifest
4040
args: [--no-build-isolation]
4141
additional_dependencies: [setuptools-scm]
42+
- repo: https://github.com/codespell-project/codespell
43+
# Configuration for codespell is in pyproject.toml
44+
rev: v2.2.6
45+
hooks:
46+
- id: codespell
47+
additional_dependencies:
48+
- tomli

{{cookiecutter.package_name}}/pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,8 @@ extras =
145145
commands =
146146
pytest -v --color=yes --cov={{cookiecutter.module_name}} --cov-report=xml
147147
"""
148+
149+
150+
[tool.codespell]
151+
skip = '.git'
152+
check-hidden = true

0 commit comments

Comments
 (0)