Skip to content

Commit a0842bb

Browse files
committed
Replace Black by Ruff
1 parent a36c846 commit a0842bb

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

.flake8

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

.github/workflows/tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ jobs:
3939
python -m pip install --upgrade pip
4040
pip install -e .
4141
pip install -r requirements/test.txt
42-
- name: Test with pytest
42+
- name: Run tests and check code format
4343
run: |
44-
python3 -m pytest
45-
- name: Lint with flake8
46-
run: |
47-
flake8 .
44+
python3 -m pytest -ruff --ruff-format

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![PyPI](https://img.shields.io/pypi/v/Flask-Pydantic?color=g)](https://pypi.org/project/Flask-Pydantic/)
44
[![License](https://img.shields.io/badge/license-MIT-purple)](https://github.com/bauerji/flask_pydantic/blob/master/LICENSE)
5-
[![Code style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
65

76
Flask extension for integration of the awesome [pydantic package](https://github.com/samuelcolvin/pydantic) with [Flask](https://palletsprojects.com/p/flask/).
87

@@ -343,11 +342,11 @@ Feature requests and pull requests are welcome. For major changes, please open a
343342
```bash
344343
git checkout -b <your_branch_name>
345344
```
346-
- run tests
345+
- make sure your code style is compliant with [Ruff](https://github.com/astral-sh/ruff). Your can check these errors and automatically correct some of them with `ruff check --select I --fix . `
346+
- run tests and check code format
347347
```bash
348-
python3 -m pytest
348+
python3 -m pytest --ruff --ruff-format
349349
```
350-
- if tests fails on Black tests, make sure You have your code compliant with style of [Black formatter](https://github.com/psf/black)
351350
- push your changes and create a pull request to master branch
352351

353352
## TODOs:

pyproject.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,19 @@ name = "flask_pydantic"
3737

3838
[tool.pytest]
3939
testpaths = "tests"
40-
addopts = "-vv --black --cov --cov-config=pyproject.toml -s"
41-
flake8-ignore = "E121 E122 E123 E124 E125 E126 E127 E128 E711 E712 F811 F841 H803 E501 E265 E741 W391 W503 E203"
40+
addopts = "-vv --ruff --ruff-format --cov --cov-config=pyproject.toml -s"
41+
42+
[tool.ruff]
43+
src = ["flask_pydantic"]
44+
lint.select = [
45+
"B", # flake8-bugbear
46+
"E", # pycodestyle error
47+
"F", # pyflakes
48+
"I", # isort
49+
"UP", # pyupgrade
50+
"W", # pycodestyle warning
51+
]
52+
lint.ignore = ["E501"]
4253

4354
[tool.coverage.run]
4455
branch = true

requirements/test.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pytest
22
pytest-flask
3-
pytest-flake8
43
pytest-coverage
5-
pytest-black
64
pytest-mock
5+
pytest-ruff

0 commit comments

Comments
 (0)