-
Notifications
You must be signed in to change notification settings - Fork 43
64 lines (58 loc) · 1.52 KB
/
lint.yml
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
---
name: Linters
on: # yamllint disable-line rule:truthy
workflow_call:
workflow_dispatch:
env:
FORCE_COLOR: "1" # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
PYTHON_LATEST: "3.11"
jobs:
lint-ruff:
name: Lint with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_LATEST }}
check-latest: true
cache: pip
cache-dependency-path: |
setup.cfg
requirements-dev.txt
- name: Install dependencies
run: |
pip install -U -r requirements-dev.txt
- name: Lint with Ruff
run: |
python -m ruff check
typecheck-mypy:
name: Check typing and annotations
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_LATEST }}
check-latest: true
cache: pip
cache-dependency-path: |
setup.cfg
requirements-dev.txt
- name: Install dependencies
run: |
pip install -U -r requirements-dev.txt
- name: Typecheck with mypy
run: |
echo "::add-matcher::.github/workflows/mypy-matcher.json"
python -m mypy aiomonitor/ examples/ tests/