Skip to content

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

Merged
merged 2 commits into from
May 22, 2017
Merged

linting for the api module #2870

merged 2 commits into from
May 22, 2017

Conversation

smcoll
Copy link
Contributor

@smcoll smcoll commented May 22, 2017

No description provided.

Copy link
Contributor

@agjohnson agjohnson left a 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.

@@ -207,7 +216,7 @@ def override_urls(self):
name="api_get_anchor"),
]

def get_anchor(self, request, **kwargs):
def get_anchor(self, request):
Copy link
Contributor

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

Copy link
Contributor Author

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

@@ -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
Copy link
Contributor

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

Copy link
Contributor Author

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.

@@ -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):
Copy link
Contributor

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.

@agjohnson agjohnson modified the milestone: Cleanup May 22, 2017
@agjohnson agjohnson merged commit a9f9be2 into readthedocs:master May 22, 2017
fmoor pushed a commit to fmoor/readthedocs.org that referenced this pull request May 24, 2017
* linting for the api module

* restore positional arguments, even thought they're discarded, to accomodate potential current usages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants