-
Notifications
You must be signed in to change notification settings - Fork 136
75 lines (61 loc) · 1.74 KB
/
Copy pathlint.yml
File metadata and controls
75 lines (61 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
pip install -e ".[dev]"
- name: Run pre-commit on all files
run: |
pre-commit run --all-files
- name: What to do if this action fails
if: ${{ failure() }}
run: |
echo "To fix these issues locally:"
echo "1. Install pre-commit: pip install pre-commit"
echo "2. Set up pre-commit hooks: pre-commit install"
echo "3. Run pre-commit on all files: pre-commit run --all-files"
echo "4. Commit the changes and push again"
black-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black>=25.1.0
- name: Run Black
run: |
black --check src tests
isort-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install isort>=6.0.0
- name: Run isort
run: |
isort --check-only --profile black src tests