Repository navigation
.pre-commit-config.yaml → prek.toml - #648
samcunliffe wants to merge 3 commits into
Conversation
a986c43 to
26095c6
Compare
49838b9 to
7e71560
Compare
e600715 to
dccaec8
Compare
Toml sort prek itself. Fix some docs. Add prek (and other) badges.
dccaec8 to
cd9ae5d
Compare
|
|
||
| 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) |
There was a problem hiding this comment.
The link checker will fail until this PR is merged, because this file doesn't exist on main.
There was a problem hiding this comment.
That's okay, as an admin you should be able to bypass (pending review).
|
Hope you didn't get excessive notifications for this @paddyroddy. 🫠 I had some embarrassing fails because of the regression test data. |
It's okay, it all gets nicely threaded in Outlook anyway. |
|
|
||
| exclude = "^{{cookiecutter.project_slug}}/|^tests/data/test_package_generation/" | ||
|
|
||
| [[repos]] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Also means toml-sort has nothing to sort as they're all called [[repos]]
| [[repos]] | ||
| hooks = [{id = "ruff-check"}, {id = "ruff-format"}] | ||
| repo = "https://github.com/astral-sh/ruff-pre-commit" | ||
| rev = "v0.15.19" |
There was a problem hiding this comment.
I think syntax would be so nice. Doesn't seem possible to automate with toml-sort at the moment though. trailing_comma_inline_array only works on arrays 😢 maybe we should raise an issue?
| [[repos]] | |
| hooks = [{id = "ruff-check"}, {id = "ruff-format"}] | |
| repo = "https://github.com/astral-sh/ruff-pre-commit" | |
| rev = "v0.15.19" | |
| [[repos]] | |
| hooks = [ | |
| {id = "ruff-check"}, | |
| {id = "ruff-format"}, | |
| ] | |
| repo = "https://github.com/astral-sh/ruff-pre-commit" | |
| rev = "v0.15.19" |
There was a problem hiding this comment.
Some of this might help when TOML 1.1.0 makes it's way into Python glass-dev/glass#1199.
| {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"}, |
There was a problem hiding this comment.
Like something about this format is odd. It's nicer than YAML, but quite as nice as it could be.
| {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"}, |
There was a problem hiding this comment.
Yeah this is the downside of TOML... Strings


Follows on from
pre-commitwithprek#645prek. #644Replace the pre-commit-config files, since it's a bit confusing to have a config file named after a legacy tool.