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

Run ruff with tox #429

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Checks that Pylint does not complain Postgres model fields.
"""
# pylint: disable=C0111,W5101
from __future__ import print_function

from django.contrib.postgres import fields
from django.db import models
Expand Down
4 changes: 1 addition & 3 deletions pylint_django/tests/input/func_hard_coded_auth_user.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# pylint: disable=missing-docstring, wildcard-import, unused-wildcard-import
# flake8: noqa=F401, F403

from django.contrib.auth.models import * # [imported-auth-user]
from django.contrib.auth.models import User # [imported-auth-user]
from django.contrib.auth.models import * # [imported-auth-user] # noqa: F403
from django.db import models


Expand Down
1 change: 0 additions & 1 deletion pylint_django/tests/input/func_noerror_form_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
methods on Django form forms.
"""
# pylint: disable=missing-docstring
from __future__ import print_function

from datetime import date, datetime

Expand Down
1 change: 0 additions & 1 deletion pylint_django/tests/input/func_noerror_model_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
methods on Django model fields.
"""
# pylint: disable=missing-docstring
from __future__ import print_function

from datetime import date, datetime
from decimal import Decimal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
and https://docs.djangoproject.com/en/1.9/ref/models/meta/)
"""
# pylint: disable=missing-docstring
from __future__ import print_function

from django.db import models

Expand Down
1 change: 0 additions & 1 deletion pylint_django/tests/input/func_noerror_uuid_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Checks that Pylint does not complain about UUID fields.
"""
# pylint: disable=missing-class-docstring,missing-function-docstring
from __future__ import print_function

from django.db import models

Expand Down
2 changes: 1 addition & 1 deletion pylint_django/tests/input/migrations/0002_new_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

> ... adding columns with default values will cause a full rewrite of
> the table, for a time proportional to its size.
> For this reason, its recommended you always create new columns with
> For this reason, it's recommended you always create new columns with
> null=True, as this way they will be added immediately.
"""
# pylint: disable=missing-docstring, invalid-name
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ max-line-length = 120

[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ commands =
clean: find . -type d -name __pycache__ -delete
clean: rm -rf build/ .cache/ dist/ .eggs/ pylint_django.egg-info/ .tox/
deps =
ruff: ruff
pylint: pylint<3
pylint: Django
readme: twine
Expand All @@ -50,3 +49,7 @@ allowlist_externals =
py{37,38,39,310,311}-django{22,30,31,32,40,41,42}: bash
clean: find
clean: rm

[testenv:ruff]
commands = ruff check
deps = ruff