Skip to content

Commit 2c6d575

Browse files
committed
Update lint workflow to use pre-commit
1 parent 609a825 commit 2c6d575

File tree

1 file changed

+18
-43
lines changed

1 file changed

+18
-43
lines changed

.github/workflows/lint.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,24 @@ jobs:
2323
with:
2424
fetch-depth: 1
2525
path: "pulpcore"
26-
2726
- uses: "actions/setup-python@v5"
2827
with:
2928
python-version: "3.11"
30-
31-
- name: "Install python dependencies"
32-
run: |
33-
echo ::group::PYDEPS
34-
pip install -r lint_requirements.txt
35-
echo ::endgroup::
36-
37-
- name: "Lint workflow files"
38-
run: |
39-
yamllint
40-
41-
- name: "Verify bump version config"
42-
run: |
43-
bump-my-version bump --dry-run release
44-
bump-my-version show-bump
45-
46-
# run black separately from flake8 to get a diff
47-
- name: "Run black"
48-
run: |
49-
black --version
50-
black --check --diff .
51-
52-
# Lint code.
53-
- name: "Run flake8"
54-
run: |
55-
flake8
56-
57-
- name: "Run extra lint checks"
58-
run: |
59-
[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh
60-
61-
- name: "Check for any files unintentionally left out of MANIFEST.in"
62-
run: |
63-
check-manifest
64-
65-
- name: "Verify requirements files"
66-
run: |
67-
python .ci/scripts/check_requirements.py
68-
69-
- name: "Check for common gettext problems"
70-
run: |
71-
sh .ci/scripts/check_gettext.sh
29+
# cache example from:
30+
# https://pre-commit.com/#github-actions-example
31+
- name: set PY
32+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
33+
- uses: actions/cache@v5
34+
with:
35+
path: ~/.cache/pre-commit
36+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
37+
- name: Install pre-commit
38+
run: |
39+
pip install pre-commit
40+
- name: Run pre-commit
41+
shell: "bash"
42+
env:
43+
PY_COLORS: "1"
44+
FORCE_COLOR: "1"
45+
run: |
46+
pre-commit run --all-files -v

0 commit comments

Comments
 (0)