Skip to content

Commit 2904f21

Browse files
committed
build(ci): add pre-commit linting gate to CI pipeline
Add a `pre-commit` Makefile target that runs a series of pre-commit hooks (trailing-whitespace, end-of-file-fixer, markdownlint, yamllint, cspell) and integrate it into the `ci` aggregate target, ensuring code quality checks are enforced before a task is considered done.
1 parent 98e5bac commit 2904f21

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ test-cluster: stop-dev-cluster
8181
exit $$rc
8282

8383
# ci aggregates the gates required before declaring a task done (see AGENTS.md).
84-
ci: lint typecheck test-race sec build
84+
ci: lint typecheck test-race pre-commit sec build
8585
@echo "All CI gates passed."
8686

8787
# bench runs the benchmark tests in the benchmark subpackage of the tests package.
@@ -215,6 +215,14 @@ docs-publish: docs-build
215215
docs-serve: docs-build
216216
PYENV_VERSION=mkdocs mkdocs serve
217217

218+
pre-commit:
219+
pre-commit run -a trailing-whitespace && \
220+
pre-commit run -a end-of-file-fixer && \
221+
pre-commit run -a markdownlint && \
222+
pre-commit run -a yamllint && \
223+
pre-commit run -a cspell && \
224+
pre-commit run -a cspell
225+
218226
# check_command_exists is a helper function that checks if a command exists.
219227
define check_command_exists
220228
@which $(1) > /dev/null 2>&1 || (echo "$(1) command not found" && exit 1)

0 commit comments

Comments
 (0)