Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace flake8 with ruff #256

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff

- id: ruff # See pyproject.toml for args

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
- id: codespell # See pyproject.toml for args
additional_dependencies:
- tomli
args:
[--skip, "*.po"]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docs:
$(MAKE) -C docs clean html

test:
@flake8
@ruff .
@isort --check-only --diff formtools tests
@ python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run `which django-admin` test tests
@coverage report
Expand Down
4 changes: 2 additions & 2 deletions formtools/wizard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
return self.count

def __repr__(self):
return '<StepsHelper for %s (steps: %s)>' % (self._wizard, self.all)
return f'<StepsHelper for {self._wizard} (steps: {self.all})>'

Check warning on line 44 in formtools/wizard/views.py

View check run for this annotation

Codecov / codecov/patch

formtools/wizard/views.py#L44

Added line #L44 was not covered by tests

@property
def all(self):
Expand Down Expand Up @@ -109,7 +109,7 @@
template_name = 'formtools/wizard/wizard_form.html'

def __repr__(self):
return '<%s: forms: %s>' % (self.__class__.__name__, self.form_list)
return f'<{self.__class__.__name__}: forms: {self.form_list}>'

@classonlymethod
def as_view(cls, *args, **kwargs):
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,22 @@ zip-safe = false
exclude = ["tests"] # tests.*
namespaces = false

[tool.codespell]
skip = "*.po"

[tool.isort]
combine_as_imports = true
default_section = "THIRDPARTY"
include_trailing_comma = true
known_first_party = ["formtools"]
line_length = 79
multi_line_output = 5

[tool.ruff]
ignore = ["PLW2901"]
line-length = 119
select = ["ASYNC", "C4", "C90", "DJ", "E", "F", "PL", "UP", "W"]

[tool.ruff.per-file-ignores]
"tests/wizard/test_forms.py" = ["DJ007", "DJ008"]
"tests/wizard/wizardtests/tests.py" = ["DJ007"]
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
coverage==7.3.2
flake8
isort>=5.11.1, <6.0
ruff