Skip to content

Adjust to new flake8 3.6.0 version #501

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

Merged
merged 1 commit into from
Oct 24, 2018
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
2 changes: 1 addition & 1 deletion requirements-development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ django-filter>=2.0
django-polymorphic>=2.0
factory-boy
Faker
flake8
flake8==3.6.0
flake8-isort
isort
mock
Expand Down
14 changes: 6 additions & 8 deletions rest_framework_json_api/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,12 @@ def get_links(self, obj=None, lookup_field='pk'):
})
self_link = self.get_url('self', self.self_link_view_name, self_kwargs, request)

"""
Assuming RelatedField will be declared in two ways:
1. url(r'^authors/(?P<pk>[^/.]+)/(?P<related_field>\w+)/$',
AuthorViewSet.as_view({'get': 'retrieve_related'}))
2. url(r'^authors/(?P<author_pk>[^/.]+)/bio/$',
AuthorBioViewSet.as_view({'get': 'retrieve'}))
So, if related_link_url_kwarg == 'pk' it will add 'related_field' parameter to reverse()
"""
# Assuming RelatedField will be declared in two ways:
# 1. url(r'^authors/(?P<pk>[^/.]+)/(?P<related_field>\w+)/$',
# AuthorViewSet.as_view({'get': 'retrieve_related'}))
# 2. url(r'^authors/(?P<author_pk>[^/.]+)/bio/$',
# AuthorBioViewSet.as_view({'get': 'retrieve'}))
# So, if related_link_url_kwarg == 'pk' it will add 'related_field' parameter to reverse()
if self.related_link_url_kwarg == 'pk':
related_kwargs = self_kwargs
else:
Expand Down
12 changes: 9 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ test = pytest
universal = 1

[flake8]
ignore = F405
ignore = F405,W504
max-line-length = 100
exclude =
docs/conf.py,
build,
docs/conf.py,
migrations,
.eggs
.tox,

[isort]
Expand All @@ -21,7 +22,12 @@ known_localfolder = example
known_standard_library = mock
line_length = 100
multi_line_output = 3
skip=migrations,.tox,docs/conf.py
skip=
build,
docs/conf.py,
migrations,
.eggs
.tox,

[coverage:report]
omit=
Expand Down