Skip to content

Commit 2072f5a

Browse files
authored
build: lint and format with ruff (#70)
1 parent 4121d6d commit 2072f5a

7 files changed

Lines changed: 23 additions & 72 deletions

File tree

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/black.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/flake8.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Run unit tests
1+
name: Tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,8 +12,11 @@ jobs:
1112
timeout-minutes: 5
1213
strategy:
1314
matrix:
14-
python-version: ["3.11", "3.12", "3.13"]
15-
15+
python-version:
16+
- "3.11"
17+
- "3.12"
18+
- "3.13"
19+
- "3.14"
1620
steps:
1721
- uses: actions/checkout@v6
1822
- name: Set up Python ${{ matrix.python-version }}
@@ -23,6 +27,10 @@ jobs:
2327
run: |
2428
pip install -U pip
2529
pip install -r requirements.txt
30+
- name: Lint and check formatting
31+
run: |
32+
ruff check .
33+
ruff format --check .
2634
- name: Run all tests
2735
run: |
2836
pytest . -v

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ python3 app.py
4545

4646
#### Linting
4747
```zsh
48-
# Run flake8 from root directory for linting
49-
flake8 *.py && flake8 listeners/
48+
# Run ruff from root directory for linting
49+
ruff check .
5050

51-
# Run black from root directory for code formatting
52-
black .
51+
# Run ruff from root directory for code formatting
52+
ruff format .
5353
```
5454

5555
#### Testing

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
[tool.black]
1+
[tool.ruff]
22
line-length = 125
3+
exclude = [".venv", "venv"]
4+
5+
[tool.ruff.format]
6+
quote-style = "double"
37

48
[tool.pytest.ini_options]
59
testpaths = ["tests"]

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
slack-bolt==1.27.0
21
pytest==9.0.2
3-
flake8==7.3.0
4-
black==25.12.0
2+
ruff==0.9.4
3+
slack-bolt==1.27.0

0 commit comments

Comments
 (0)