forked from modmail-dev/Modmail
-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (37 loc) · 1.02 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
name: Lint python
on:
push:
branches:
- stable
- develop
pull_request:
jobs:
code-style:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
name: Python ${{ matrix.python-version }} on ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: Gr1N/setup-poetry@v9
- name: Cache poetry
id: cache-poetry
uses: actions/[email protected]
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Maybe install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-root --only dev
- name: Ruff
run: poetry run ruff . --no-fix --config pyproject.toml
continue-on-error: true
- name: Black
run: |
poetry run black . --diff --check --config pyproject.toml