Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/prek
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
key: prek-${{ hashFiles('prek.toml') }}

- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/prek
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
key: prek-${{ hashFiles('prek.toml') }}

- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
Expand Down
64 changes: 0 additions & 64 deletions .pre-commit-config.yaml

This file was deleted.

8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Contributing Guide

Check warning on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.FleschReadingEase] Try to keep the Flesch reading ease score (62.33) above 70.
Raw output
{"message": "[Readability.FleschReadingEase] Try to keep the Flesch reading ease score (62.33) above 70.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}

Check warning on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.LIX] Try to keep the LIX score (37.42) below 35.
Raw output
{"message": "[Readability.LIX] Try to keep the LIX score (37.42) below 35.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}

Check warning on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.SMOG] Try to keep the SMOG grade (10.44) below 10.
Raw output
{"message": "[Readability.SMOG] Try to keep the SMOG grade (10.44) below 10.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}

Check warning on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.ColemanLiau] Try to keep the Coleman–Liau Index grade (9.42) below 9.
Raw output
{"message": "[Readability.ColemanLiau] Try to keep the Coleman–Liau Index grade (9.42) below 9.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'contribute' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'contribute' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 4}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'opinionated' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'opinionated' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 5}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'actively' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'actively' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 8}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'probably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'probably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 9}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'Scientific' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'Scientific' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 11}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'installing' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'installing' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 15}}}, "severity": "INFO"}

Check notice on line 1 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L1

[Readability.Polysyllables] 'encouraging' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'encouraging' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 1, "column": 17}}}, "severity": "INFO"}

Check notice on line 2 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L2

[Readability.Polysyllables] 'locally' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'locally' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 2, "column": 1}}}, "severity": "INFO"}
[![Link Checker](https://github.com/UCL-ARC/python-tooling/actions/workflows/links.yml/badge.svg)](https://github.com/UCL-ARC/python-tooling/actions/workflows/links.yml)

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'recommendation' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'recommendation' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 1}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'cookiecutter' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'cookiecutter' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 4}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'specific' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'specific' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 7}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'presumably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'presumably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 10}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'policy' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'policy' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 16}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'contributions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'contributions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 22}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'suggestions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'suggestions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 24}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'reviewers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'reviewers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 38}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'available' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'available' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 39}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'discussions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'discussions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 40}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'probably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'probably' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 49}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'engineers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'engineers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 53}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'discussions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'discussions' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 59}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'associate' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'associate' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 67}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'following' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'following' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 77}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'repository' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'repository' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 83}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'associate' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'associate' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 86}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'something' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'something' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 100}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'Computing' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'Computing' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 101}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'reviewers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'reviewers' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 137}}}, "severity": "INFO"}

Check notice on line 3 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L3

[Readability.Polysyllables] 'anything' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'anything' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 3, "column": 150}}}, "severity": "INFO"}
[![Linting](https://github.com/UCL-ARC/python-tooling/actions/workflows/linting.yml/badge.svg)](https://github.com/UCL-ARC/python-tooling/actions/workflows/linting.yml)

Check notice on line 4 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L4

[Readability.Polysyllables] 'opinionated' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'opinionated' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 4, "column": 14}}}, "severity": "INFO"}

Check notice on line 4 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L4

[Readability.Polysyllables] 'reviewer' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'reviewer' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 4, "column": 32}}}, "severity": "INFO"}

Check notice on line 4 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L4

[Readability.Polysyllables] 'useful' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'useful' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 4, "column": 37}}}, "severity": "INFO"}

Check notice on line 4 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / vale

[vale] CONTRIBUTING.md#L4

[Readability.Polysyllables] 'reviewer' has three or more syllables. It counts toward the SMOG and Gunning fog scores.
Raw output
{"message": "[Readability.Polysyllables] 'reviewer' has three or more syllables. It counts toward the SMOG and Gunning fog scores.", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 4, "column": 55}}}, "severity": "INFO"}
[![Run template tests](https://github.com/UCL-ARC/python-tooling/actions/workflows/test.yml/badge.svg)](https://github.com/UCL-ARC/python-tooling/actions/workflows/test.yml)
[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)
[![prek](https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge.svg)](https://github.com/j178/prek)

This template and our [recommendation pages][website] were made by [research
software engineers] at [UCL's Centre for Advanced Research Computing][UCL ARC].
We made it with research software projects in mind, but whoever you are, we hope
Expand Down Expand Up @@ -62,8 +68,6 @@

#### Python version support

[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)

We follow Scientific Python's [SPEC 0](https://scientific-python.org/specs/spec-0000/) policy.
Notably this means our template will support [Python versions for three years after their release](https://scientific-python.org/specs/spec-0000/#support-window), and changes to the template are required to pass tests in all such python versions.
(See [the CI checks](./.github/workflows/test.yml) for precise details.)
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/linting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ layout: default
## Linting

See
[here for an example configuration](https://github.com/UCL-ARC/python-tooling/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/.pre-commit-config.yaml)
[here for an example configuration](https://github.com/UCL-ARC/python-tooling/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/prek.toml)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link checker will fail until this PR is merged, because this file doesn't exist on main.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's okay, as an admin you should be able to bypass (pending review).

for some of these.

### Code formatting
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@

The package is set-up to use [prek](https://prek.j178.dev/), a framework for running [Git hook scripts](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) on each commit to the repository.

There is a `.pre-commit-config.yaml` configuration file which you can take a look at.
There is a `prek.toml` configuration file which you can take a look at.

Check failure on line 403 in docs/pages/tutorial.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/pages/tutorial.md#L403

[write-good.ThereIs] Don't start a sentence with 'There is'.
Raw output
{"message": "[write-good.ThereIs] Don't start a sentence with 'There is'.", "location": {"path": "docs/pages/tutorial.md", "range": {"start": {"line": 403, "column": 1}}}, "severity": "ERROR"}
Comment thread
samcunliffe marked this conversation as resolved.
With this setup `prek` will run a series of fast linters, checks and formatters on the repository on every commit.

The main tools we recommend are [ruff](https://docs.astral.sh/ruff/), [ty](https://docs.astral.sh/ty/) and [prettier](https://prettier.io/).
Expand Down
73 changes: 73 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration file for `prek`, a git hook framework written in Rust.
# See https://prek.j178.dev for more information.
# :schema https://www.schemastore.org/prek.json
Comment thread
samcunliffe marked this conversation as resolved.
# ^ Remove the space here when toml-sort/#105 is resolved. The directive should be: '#:schema'

exclude = "^{{cookiecutter.project_slug}}/|^tests/data/test_package_generation/"

[[repos]]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a shame it's this syntax, quite ugly I think. But not that surprising.

I really like in a pyproject.toml having, e.g. one [project], one [dependency-groups], each [tool.<x>] having it's own section. Never really got the [[<x>]] format.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also means toml-sort has nothing to sort as they're all called [[repos]]

hooks = [
{args = [
"--config=pyproject.toml",
], id = "ruff-check"},
{args = [
"--config=pyproject.toml",
], id = "ruff-format"},
]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.19"

[[repos]]
hooks = [{args = ["--dot"], id = "markdownlint-fix"}]
repo = "https://github.com/igorshubovych/markdownlint-cli"
rev = "v0.49.1"

[[repos]]
hooks = [{id = "forbid-tabs"}]
repo = "https://github.com/Lucas-C/pre-commit-hooks"
rev = "v1.5.6"

[[repos]]
hooks = [{id = "toml-sort-fix"}]
repo = "https://github.com/pappasam/toml-sort"
rev = "v0.24.4"

[[repos]]
hooks = [
{args = [
"--group=typechecking",
"--isolated",
"--no-default-groups",
], id = "ty"},
]
repo = "https://github.com/astral-sh/ty-pre-commit"
rev = "v0.0.79"

[[repos]]
hooks = [{args = ["--quote-props=as-needed"], id = "prettier"}]
repo = "https://github.com/rbubley/mirrors-prettier"
rev = "v3.8.4"

[[repos]]
hooks = [
{args = [
"--fix=lf",
], id = "mixed-line-ending"},
{id = "check-case-conflict"},
{id = "check-docstring-first"},
{id = "check-merge-conflict"},
{id = "end-of-file-fixer"},
{id = "trailing-whitespace"},
]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v6.0.0"

[[repos]]
hooks = [
{args = [
"--schemafile=.github/schemas/github-issue-forms.json",
"--verbose",
], exclude = '^\.github/ISSUE_TEMPLATE/config\.yml$', files = '^\.github/ISSUE_TEMPLATE/.*\.yml$', id = "check-jsonschema", name = "Validate GitHub issue templates"},
]
repo = "https://github.com/python-jsonschema/check-jsonschema"
rev = "0.38.0"
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/prek
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
key: prek-${{ hashFiles('prek.toml') }}

- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.x"
cache: pip
cache-dependency-path: pyproject.toml
cache-dependency-path: prek.toml

- name: Install dependencies
run: python -m pip install prek
Expand Down
60 changes: 0 additions & 60 deletions tests/data/test_package_generation/.pre-commit-config.yaml

This file was deleted.

62 changes: 62 additions & 0 deletions tests/data/test_package_generation/prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# :schema https://www.schemastore.org/prek.json

[[repos]]
hooks = [{id = "ruff-check"}, {id = "ruff-format"}]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.19"

[[repos]]
hooks = [{args = ["--dot"], id = "markdownlint-fix"}]
repo = "https://github.com/igorshubovych/markdownlint-cli"
rev = "v0.49.1"

[[repos]]
hooks = [{id = "forbid-tabs"}]
repo = "https://github.com/Lucas-C/pre-commit-hooks"
rev = "v1.5.6"

[[repos]]
hooks = [{id = "toml-sort-fix"}]
repo = "https://github.com/pappasam/toml-sort"
rev = "v0.24.4"

[[repos]]
hooks = [
{args = [
"--group=typechecking",
"--isolated",
"--no-default-groups",
], id = "ty"},
]
repo = "https://github.com/astral-sh/ty-pre-commit"
rev = "v0.0.79"

[[repos]]
hooks = [{args = ["--quote-props=as-needed"], id = "prettier"}]
repo = "https://github.com/rbubley/mirrors-prettier"
rev = "v3.8.4"

[[repos]]
hooks = [
{args = [
"--fix=lf",
], id = "mixed-line-ending"},
{id = "check-case-conflict"},
{id = "check-docstring-first"},
{id = "check-merge-conflict"},
{id = "check-toml"},
{id = "end-of-file-fixer"},
{id = "trailing-whitespace"},
Comment on lines +41 to +49

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like something about this format is odd. It's nicer than YAML, but quite as nice as it could be.

]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v6.0.0"

[[repos]]
hooks = [
{args = [
"--schemafile=.github/schemas/github-issue-forms.json",
"--verbose",
], exclude = '^\.github/ISSUE_TEMPLATE/config\.yml$', files = '^\.github/ISSUE_TEMPLATE/.*\.yml$', id = "check-jsonschema", name = "Validate GitHub issue templates"},
Comment on lines +56 to +59

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is the downside of TOML... Strings

]
repo = "https://github.com/python-jsonschema/check-jsonschema"
rev = "0.38.0"
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/.github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/prek
key: prek-${{ '{{' }} hashFiles('.pre-commit-config.yaml') {{ '}}' }}
key: prek-${{ '{{' }} hashFiles('prek.toml') {{ '}}' }}

- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.x"
cache: pip
cache-dependency-path: pyproject.toml
cache-dependency-path: prek.toml

- name: Install dependencies
run: python -m pip install prek
Expand Down
Loading
Loading