Skip to content

Commit

Permalink
Use ruff instead of flake8 (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
luolingchun authored Aug 4, 2024
1 parent 11932b1 commit e3e6672
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Checklist:

- [ ] Run `pytest tests` and no failed.
- [ ] Run `flake8 flask_openapi3 tests examples` and no failed.
- [ ] Run `ruff check flask_openapi3 tests examples` and no failed.
- [ ] Run `mypy flask_openapi3` and no failed.
- [ ] Run `mkdocs serve` and no failed.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ jobs:
pip install -U "${{ matrix.flask-version }}"
pip install -U pydantic
pip install -U -r ./requirements/test.txt
pip install -U -r ./requirements/flake8.txt
pip install -U -r ./requirements/ruff.txt
pip install -U -r ./requirements/mypy.txt
pip install -e .[swagger]
# pip install -e .[swagger,redoc,rapidoc,rapipdf,scalar,elements]
# pip install -e .[swagger,redoc,rapidoc,rapipdf,scalar,elements]

- name: Test with pytest
run: pytest tests

- name: Flake8
run: flake8 flask_openapi3 examples tests
- name: ruff
run: ruff check flask_openapi3 tests examples

- name: cache mypy
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Before submitting pr, you need to complete the following steps:
pytest tests
```

3. Running the flake8
3. Running the ruff

```bash
flake8 flask_openapi3 tests examples
ruff check flask_openapi3 tests examples
```

4. Running the mypy
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ include = [
"/LICENSE.rst"
]

[tool.ruff]
line-length = 120

[tool.flake8]
per-file-ignores = ["__init__.py:F401"]
max-line-length = 120
count = true

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

[tool.mypy]
files = "src"
Expand Down
2 changes: 0 additions & 2 deletions requirements/flake8.txt

This file was deleted.

1 change: 1 addition & 0 deletions requirements/ruff.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruff

0 comments on commit e3e6672

Please sign in to comment.