Skip to content

Commit

Permalink
Add and configure ruff
Browse files Browse the repository at this point in the history
- Add ruff to project requirements
- Configure ruff in pyproject.toml
- Add pytest-black and pytest-ruff
- Remove pytest-flakes and pytest-pep8
- Remove pytest.ini
- Update circleci job to run ruff as part of pytest
  • Loading branch information
Bekabyx committed Jul 31, 2023
1 parent 2096ff4 commit b50e75d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
name: run pytest
command: |
. .venv/bin/activate
pytest -sx --flakes --cov-report= --cov=wcivf --junitxml=test-results/junit.xml
pytest -sx --ruff --cov-report= --cov=wcivf --junitxml=test-results/junit.xml
- run: |
if [ -n "$COVERALLS_REPO_TOKEN" ]; then
. .venv/bin/activate
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
[tool.black]
line-length = 80

[tool.ruff]
line-length = 80
ignore = ["E501"]
extend-select = [
"I",
"C4",
"SIM",
"Q003",
"RET",
]
extend-exclude = ["wcivf/settings/local.py"]

[tool.pytest.ini_options]
norecursedirs =[
"src",
"wcivf/static_root",
".aws-sam",
".ruff-cache",
".circleci",
]
DJANGO_SETTINGS_MODULE = "wcivf.settings.base"
addopts =[
"--ignore=*/__pycache__",
"--ignore=.*",
"--ignore=.download-cache",
"--ignore=wcivf/settings/local.py",
"--ignore=lib",
"--ruff",
"--black",
]
8 changes: 0 additions & 8 deletions pytest.ini

This file was deleted.

5 changes: 3 additions & 2 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ black==23.7.0

pytest
pytest-django
pytest-pep8
pytest-flakes
pytest-cov
factory_boy
vcrpy==5.0.0
Expand All @@ -16,3 +14,6 @@ tomlkit
freezegun==1.2.2
django-debug-toolbar==4.1.0
curlylint==0.13.1
ruff==0.0.280
pytest-ruff
pytest-black

0 comments on commit b50e75d

Please sign in to comment.