Skip to content

Commit 4835d1c

Browse files
authored
Replace black/flake8/isort with Ruff (#42)
* Replace black/flake8/isort with Ruff * Create Ruff action * Bump actions/checkout
1 parent 1a2fb79 commit 4835d1c

File tree

5 files changed

+66
-173
lines changed

5 files changed

+66
-173
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2424

2525
# Login against a Docker registry except on PR
2626
# https://github.com/docker/login-action

.github/workflows/ruff.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Ruff
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ruff:
7+
runs-on: ubuntu-24.04
8+
permissions:
9+
contents: read
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Run Ruff check
16+
uses: astral-sh/ruff-action@v3
17+
with:
18+
args: "check --diff"
19+
20+
- name: Run Ruff format
21+
uses: astral-sh/ruff-action@v3
22+
with:
23+
args: "format --check --diff"

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ WEATHER_UNITS | No | metric | Units of measurement for the temperature, `metric`
7777

7878
## Development
7979

80+
This project uses Poetry for package management and Ruff for linting and formatting.
81+
8082
Run
8183

8284
```shell
@@ -91,6 +93,13 @@ docker compose -f docker-compose.dev.yml up --build
9193

9294
locally to start the application, API docs will be served at <http://localhost:5000/docs>.
9395

96+
### Linting & Formatting
97+
98+
```shell
99+
poetry run ruff check --fix
100+
poetry run ruff format
101+
```
102+
94103
## Acknowledgements
95104

96105
- [MagInkDash](https://github.com/speedyg0nz/MagInkDash): Starting point for this project

poetry.lock

Lines changed: 32 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ structlog = "^24.4.0"
2020
uvicorn = "^0.34.1"
2121

2222
[tool.poetry.group.dev.dependencies]
23-
black = "^24.10.0"
24-
flake8 = "^7.1.1"
25-
isort = "^5.13.2"
23+
ruff = "^0.12.10"
2624

2725
[build-system]
2826
requires = ["poetry-core"]

0 commit comments

Comments
 (0)