-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
linting for the api module #2870
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few notes of things to double check, but otherwise looks good.
readthedocs/api/base.py
Outdated
@@ -207,7 +216,7 @@ def override_urls(self): | |||
name="api_get_anchor"), | |||
] | |||
|
|||
def get_anchor(self, request, **kwargs): | |||
def get_anchor(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll want to double check that kwargs
is not required by anything that we override with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just replaced that with `**__`` instead
readthedocs/api/utils.py
Outdated
@@ -70,14 +71,15 @@ def _url_template(self, query, selected_facets): | |||
}) | |||
return url_template + '?' + query_string | |||
|
|||
def _search(self, request, model, facets=None, page_size=20, | |||
def _search(self, request, model, facets=None, page_size=20, # pylint: disable=too-many-locals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could go on L75 or on a separate line after that I believe, to not break up args with a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that could be done; thanks.
readthedocs/api/utils.py
Outdated
@@ -154,7 +159,7 @@ def is_authenticated(self, request, **kwargs): | |||
|
|||
|
|||
class EnhancedModelResource(ModelResource): | |||
def obj_get_list(self, request=None, *args, **kwargs): | |||
def obj_get_list(self, request=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though not used here, we should also ensure args
was not used or required. For instance, if ModelResource
has additional positional arguments.
…modate potential current usages
* linting for the api module * restore positional arguments, even thought they're discarded, to accomodate potential current usages
No description provided.