diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4622f995a..2e6634879 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,4 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - uses: pre-commit/action@v3.0.1 + - uses: j178/prek-action@v1 diff --git a/Makefile b/Makefile index a3e176438..195f76f66 100644 --- a/Makefile +++ b/Makefile @@ -95,13 +95,13 @@ _ensure-package: venv $(VENVDIR)/bin/python3 -m pip install $(PACKAGE); \ fi -.PHONY: _ensure-pre-commit -_ensure-pre-commit: - make _ensure-package PACKAGE=pre-commit +.PHONY: _ensure-prek +_ensure-prek: + make _ensure-package PACKAGE=prek .PHONY: lint -lint: _ensure-pre-commit - $(VENVDIR)/bin/python3 -m pre_commit run --all-files +lint: _ensure-prek + $(VENVDIR)/bin/python3 -m prek run --all-files # Generate all release cycle files together with a single script invocation # Use branches.csv as the primary target, others depend on it diff --git a/getting-started/pull-request-lifecycle.rst b/getting-started/pull-request-lifecycle.rst index d1f7e26a5..b1012e7db 100644 --- a/getting-started/pull-request-lifecycle.rst +++ b/getting-started/pull-request-lifecycle.rst @@ -111,7 +111,7 @@ You should have already :ref:`set up your system `, (Learn more about :ref:`good-commits`) -* If your code isn't linted correctly, :ref:`pre-commit ` +* If your code isn't linted correctly, :ref:`prek ` will block the commit with an error message, for example:: Doc/library/stdtypes.rst:5718: No newline at end of file. (missing-final-newline) diff --git a/getting-started/setup-building.rst b/getting-started/setup-building.rst index df208f28c..f10fab8ef 100644 --- a/getting-started/setup-building.rst +++ b/getting-started/setup-building.rst @@ -135,18 +135,18 @@ affected files as described below.) Changes for the documentation can be made from the same repository; see :ref:`documenting`. -.. _install-pre-commit: +.. _install-prek: -Install pre-commit as a Git hook --------------------------------- +Install prek as a Git hook +-------------------------- To make sure your code is linted correctly, we recommend setting up -`pre-commit `__ as a Git hook:: +`prek `__ as a Git hook:: - $ pre-commit install --allow-missing-config - pre-commit installed at .git/hooks/pre-commit + $ prek install --allow-missing-config + prek installed at .git/hooks/pre-commit -Now pre-commit will run automatically on ``git commit``. +Now prek will run automatically on ``git commit``. .. c_get_source_code_end