Skip to content

Commit 0e978bc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 602c9f2 commit 0e978bc

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Diff for: pylint_django/tests/input/external_tastypie_noerror_foreign_key.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
The issue is the lint trys resolving the `ForeignKey` for the
1010
tastypie `ForeignKey` which cause import error.
1111
"""
12-
# pylint: disable=missing-docstring
13-
from tastypie.resources import ModelResource
1412
from tastypie import fields
1513
from tastypie.fields import ForeignKey
1614

15+
# pylint: disable=missing-docstring
16+
from tastypie.resources import ModelResource
17+
1718

18-
class MyTestResource(ModelResource): # pylint: disable=too-few-public-methods
19-
field1 = ForeignKey('myapp.api.resource', 'xxx')
20-
field2 = fields.ForeignKey('myapp.api.resource', 'xxx')
19+
class MyTestResource(ModelResource): # pylint: disable=too-few-public-methods
20+
field1 = ForeignKey("myapp.api.resource", "xxx")
21+
field2 = fields.ForeignKey("myapp.api.resource", "xxx")

Diff for: pylint_django/transforms/foreignkey.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ def is_foreignkey_in_class(node):
1414
return False
1515

1616
# Make sure the outfit class is the subclass of django.db.models.Model
17-
is_in_django_model_class = node_is_subclass(
18-
node.parent.parent,
19-
'django.db.models.base.Model',
20-
'.Model'
21-
)
17+
is_in_django_model_class = node_is_subclass(node.parent.parent, "django.db.models.base.Model", ".Model")
2218
if not is_in_django_model_class:
2319
return False
2420

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
extras_require={
2525
"with_django": ["Django"],
26-
"for_tests": ["django_tables2", "factory-boy", "coverage", "pytest", "wheel", 'django-tastypie'],
26+
"for_tests": ["django_tables2", "factory-boy", "coverage", "pytest", "wheel", "django-tastypie"],
2727
},
2828
license="GPLv2",
2929
classifiers=[

0 commit comments

Comments
 (0)