-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (40 loc) · 1.23 KB
/
lint.yml
File metadata and controls
46 lines (40 loc) · 1.23 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
# This workflow will check our code for having a proper format, as well as the commit message to meet the expected ones
name: Lint
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
lint:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install --with test,lint
- name: Lint
run: |
poetry run ruff format --check src tests eval
poetry run ruff check src tests eval
poetry run mypy src tests eval
lint-commit:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
name: "Lint commit message"
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install commitizen
run: |
python -m pip install --upgrade pip
python -m pip install commitizen
- name: Check commit message
run: cz check --rev-range HEAD