-
-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (44 loc) · 1.54 KB
/
lint.yaml
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
name: Lint
on:
pull_request:
branches: ["**"]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch pre-commit
hatch env create
hatch --version
- name: Lint
id: lint
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
hatch run lint:style
echo "::remove-matcher owner=flake8::"
- name: Type Checking
id: check
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
hatch run lint:typing
echo "::remove-matcher owner=mypy::"
- name: Raise Errors For Linting Failures
if: |
steps.lint.outcome != 'success' ||
steps.check.outcome != 'success'
run: |
echo "Lint: ${{ steps.lint.outcome }}"
echo "Check: ${{ steps.check.outcome }}"
exit 1