-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CI enforce pre-commit clean code (#1096)
* pre-commit: Enforce pre-commit clean code via CI * ci.yml: Resolve duplication of isort and yapf By now pre-commit is already running these. * ci.yml: Move flake8 to pre-commit * README.rst: Add CI status badge for workflow "Run pre-commit" * README.rst: Fix link for CI workflow "YAPF" (ci.yml)
- Loading branch information
Showing
4 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2023 Sebastian Pipping <[email protected]> | ||
# Licensed under the Apache License Version 2.0 | ||
|
||
name: Run pre-commit | ||
|
||
# Drop permissions to minimum for security | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
- cron: '0 2 * * 5' # Every Friday at 2am | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pre_commit_run: | ||
name: Run pre-commit | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
|
||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install yapf (to be available to pre-commit) | ||
run: |- | ||
pip install \ | ||
--disable-pip-version-check \ | ||
--no-warn-script-location \ | ||
--user \ | ||
. | ||
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" | ||
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters