Skip to content

Commit d865d49

Browse files
committed
Use pre-commit in new linting workflow
1 parent c1b6816 commit d865d49

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/linting.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
linting:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v4
15+
16+
- name: Cache pre-commit
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.cache/pre-commit
20+
key: pre-commit-${{ '{{' }} hashFiles('.pre-commit-config.yaml') {{ '}}' }}
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.x"
26+
cache: pip
27+
cache-dependency-path: pyproject.toml
28+
29+
- name: Install dependencies
30+
run: python -m pip install pre-commit
31+
32+
- name: Run pre-commit
33+
run: pre-commit run --all-files --color always --verbose

0 commit comments

Comments
 (0)