Skip to content

Commit d9a744f

Browse files
authored
Merge pull request #126 from sanders41/ruff-formatter
Switch from black to ruff formatting
2 parents 84496b9 + 1ceb033 commit d9a744f

File tree

4 files changed

+264
-357
lines changed

4 files changed

+264
-357
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,23 @@ For package managment choose between:
1515

1616
Dev packages:
1717

18-
- [black](https://github.com/psf/black) for code formatting
1918
- [mypy](https://www.mypy-lang.org/) for static type checking
2019
- [pre-commit](https://github.com/pre-commit/pre-commit) for pre-commit hooks
2120
- [pytest](https://docs.pytest.org/en/latest/) for testing
2221
- [pytest-cov](https://github.com/pytest-dev/pytest-cov) for test coverage reports
23-
- [ruff](https://beta.ruff.rs/docs/) for linting
22+
- [ruff](https://beta.ruff.rs/docs/) for linting and code formatting
2423

2524
## Python project with Rust modules included packages
2625

2726
- [maturin](https://github.com/PyO3/maturin) for package management
28-
- [black](https://github.com/psf/black) for code formatting
2927
- [mypy](https://www.mypy-lang.org/) for static type checking
3028
- [pre-commit](https://github.com/pre-commit/pre-commit) for pre-commit hooks
3129
- [pytest](https://docs.pytest.org/en/latest/) for testing
3230
- [pytest-cov](https://github.com/pytest-dev/pytest-cov) for test coverage reports
33-
- [ruff](https://beta.ruff.rs/docs/) for linting
31+
- [ruff](https://beta.ruff.rs/docs/) for linting and code formatting
3432
- [PyO3](https://github.com/PyO3/pyo3) for managing the Rust/Python FFI
3533
- [justfile](https://github.com/casey/just) for running commands (to use this you will need to
36-
install just)
34+
install just)
3735

3836
## Installation
3937

src/github_actions.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
cache: "poetry"
4545
- name: Install Dependencies
4646
run: poetry install
47-
- name: Black check
48-
run: poetry run black {source_dir} tests --check
47+
- name: Ruff format check
48+
run: poetry run ruff format {source_dir} tests --check
4949
- name: Lint with ruff
5050
run: poetry run ruff check .
5151
- name: mypy check
@@ -106,8 +106,8 @@ jobs:
106106
run: |
107107
python -m pip install -U pip
108108
python -m pip install -r requirements-dev.txt
109-
- name: Black check
110-
run: black {source_dir} tests --check
109+
- name: Ruff format check
110+
run: ruff format {source_dir} tests --check
111111
- name: Lint with ruff
112112
run: ruff check .
113113
- name: mypy check
@@ -195,8 +195,8 @@ jobs:
195195
python -m pip install -e .
196196
maturin build --out dist
197197
python -m pip install --no-index --find-links=dist/ prelude-parser
198-
- name: Black check
199-
run: black {source_dir} tests --check
198+
- name: Ruff format check
199+
run: ruff format {source_dir} tests --check
200200
- name: Lint with ruff
201201
run: ruff check .
202202
- name: mypy check
@@ -287,8 +287,8 @@ jobs:
287287
cache: "poetry"
288288
- name: Install Dependencies
289289
run: poetry install
290-
- name: Black check
291-
run: poetry run black {source_dir} tests --check
290+
- name: Ruff format check
291+
run: poetry run ruff format {source_dir} tests --check
292292
- name: Lint with ruff
293293
run: poetry run ruff check .
294294
- name: mypy check
@@ -350,8 +350,8 @@ jobs:
350350
run: |
351351
python -m pip install -U pip
352352
python -m pip install -r requirements-dev.txt
353-
- name: Black check
354-
run: black {source_dir} tests --check
353+
- name: Ruff format check
354+
run: ruff format {source_dir} tests --check
355355
- name: Lint with ruff
356356
run: ruff check .
357357
- name: mypy check
@@ -440,8 +440,8 @@ jobs:
440440
python -m pip install -e .
441441
maturin build --out dist
442442
python -m pip install --no-index --find-links=dist/ prelude-parser
443-
- name: Black check
444-
run: black {source_dir} tests --check
443+
- name: Ruff format check
444+
run: ruff format {source_dir} tests --check
445445
- name: Lint with ruff
446446
run: ruff check .
447447
- name: mypy check
@@ -978,8 +978,8 @@ jobs:
978978
cache: "poetry"
979979
- name: Install Dependencies
980980
run: poetry install
981-
- name: Black check
982-
run: poetry run black {} tests --check
981+
- name: Ruff format check
982+
run: poetry run ruff format {} tests --check
983983
- name: Lint with ruff
984984
run: poetry run ruff check .
985985
- name: mypy check
@@ -1080,8 +1080,8 @@ jobs:
10801080
python -m pip install -e .
10811081
maturin build --out dist
10821082
python -m pip install --no-index --find-links=dist/ prelude-parser
1083-
- name: Black check
1084-
run: black {} tests --check
1083+
- name: Ruff format check
1084+
run: ruff format {} tests --check
10851085
- name: Lint with ruff
10861086
run: ruff check .
10871087
- name: mypy check
@@ -1151,8 +1151,8 @@ jobs:
11511151
run: |
11521152
python -m pip install -U pip
11531153
python -m pip install -r requirements-dev.txt
1154-
- name: Black check
1155-
run: black {} tests --check
1154+
- name: Ruff format check
1155+
run: ruff format {} tests --check
11561156
- name: Lint with ruff
11571157
run: ruff check .
11581158
- name: mypy check
@@ -1223,8 +1223,8 @@ jobs:
12231223
cache: "poetry"
12241224
- name: Install Dependencies
12251225
run: poetry install
1226-
- name: Black check
1227-
run: poetry run black {} tests --check
1226+
- name: Ruff format check
1227+
run: poetry run ruff format {} tests --check
12281228
- name: Lint with ruff
12291229
run: poetry run ruff check .
12301230
- name: mypy check
@@ -1296,8 +1296,8 @@ jobs:
12961296
run: |
12971297
python -m pip install -U pip
12981298
python -m pip install -r requirements-dev.txt
1299-
- name: Black check
1300-
run: black {} tests --check
1299+
- name: Ruff format check
1300+
run: ruff format {} tests --check
13011301
- name: Lint with ruff
13021302
run: ruff check .
13031303
- name: mypy check
@@ -1396,8 +1396,8 @@ jobs:
13961396
python -m pip install -e .
13971397
maturin build --out dist
13981398
python -m pip install --no-index --find-links=dist/ prelude-parser
1399-
- name: Black check
1400-
run: black {} tests --check
1399+
- name: Ruff format check
1400+
run: ruff format {} tests --check
14011401
- name: Lint with ruff
14021402
run: ruff check .
14031403
- name: mypy check

src/package_version.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use anyhow::Result;
44

55
#[derive(Debug)]
66
pub enum PreCommitHook {
7-
Black,
87
PreCommit,
98
MyPy,
109
Ruff,

0 commit comments

Comments
 (0)