Commit graph

15 commits

Author SHA1 Message Date
Dunedan
b42ea94c3c
Update the pre-commit hooks 2025-05-26 17:19:03 +02:00
Dunedan
d111d4cc84
Specify the NodeJS version for markdownlint
Running the markdownlint pre-commit hook as Gitea Action fails for
markdownlint >=0.38.0, as the NodeJS version available in the Act Runner
Docker image so too old for that. To solve this, this commit specifies a
newer NodeJS version to use.
2025-05-26 17:18:58 +02:00
Dunedan
efdc1fab0a
Add a pre-commit hook to check for large files
This checks there are no large files being committed, which aren't
stored in git-lfs.
2025-05-22 20:43:52 +02:00
Dunedan
a92a4ff45c
Update the pre-commit hooks 2025-01-11 21:44:52 +01:00
Ralph Sennhauser
28b0801e82 Print diff for ruff-format if check fails
It's a bit hard for contributors to figure out what ruff-format is
unhappy about if all they get is a return status of non zero. Enable
printing a diff with suggested changes with the pre-commit hook.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-30 06:23:22 +01:00
Ralph Sennhauser
36e1109624
Remove obsolete pre-commit excludes
With the removal of the premake sources all exclude directives in
.pre-commit-config.yaml are obsolete, so remove them.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-13 21:15:13 +01:00
Dunedan
c0232c6b5f
Specify the Python target version in ruff.toml
This ensures the same Python target version used for `ruff format`
is used for `ruff check` as well. It also allows ruff, even if it's not
run through pre-commit, to use the correct target Python version.
2024-09-21 20:54:24 +02:00
Ralph Sennhauser
966d859050 Add yamllint to pre-commit
Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
Ralph Sennhauser
87f667732c Format yaml files
The schema at https://json.schemastore.org/gitea-issue-forms.json
doesn't like empty titles, so just remove the key to the same effect as
a zero length string.

Add document start markers where they are missing.

Use a max line length of 100 as discussed with Dunedan.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
Ralph Sennhauser
631f7b292e Add pre-commit hook for shellcheck
Using shellcheck-py[1] instead of the official shellcheck-precommit[2]
to avoid a dependency on docker.

[1] https://github.com/shellcheck-py/shellcheck-py
[2] https://github.com/koalaman/shellcheck-precommit

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
Dunedan
ae3fad73ce
Add a markdownlint pre-commit hook
This adds a pre-commit hook to link Markdown files and fixes all
reported findings.
2024-08-27 10:06:31 +02:00
Ralph Sennhauser
af6cda9073 Add shfmt to .pre-commit-config
Run shfmt as part of the ci workflow.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
Dunedan
c763c010b8
Add a bunch of additional pre-commit hooks 2024-08-26 07:46:41 +02:00
Dunedan
1f51fcb87f
Add hook for non-breaking space in 0 A.D.
This replaces the existing arclint linter to ensure the project name
does only include a non-breaking space with a pre-commit hook. The regex
to check is slightly different to account for escaped non-breaking
spaces in JavaScript files and to avoid some false-positives.
2024-08-24 13:08:42 +02:00
Dunedan
d055090dd2
Add ruff pre-commit hook
Add configuration for pre-commit, ruff as a hook and configuration to
run ruff whenever a pull request is opened or code is pushed.
2024-08-24 10:54:26 +02:00