-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Resolving lint warnings and errors #1522
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
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c08eac7
Disable pylint check for logging-format-interpolation
gregmuellegger 28a0dfa
Resolve linting messages in readthedocs.api.*
gregmuellegger cca1888
Resolve linting messages in readthedocs.bookmarks.*
gregmuellegger e17973e
Resolve linting messages in readthedocs.comments.*
gregmuellegger 593b812
Resolve linting messages in readthedocs.core.*
gregmuellegger 6c65964
Resolve linting messages in readthedocs.doc_builder.*
gregmuellegger e7e2118
Resolve linting messages in readthedocs.donate.*
gregmuellegger 063ecd4
Resolve linting messages in readthedocs.gold.*
gregmuellegger 3b80741
Resolve linting messages in readthedocs.privacy.*
gregmuellegger afcf98b
Resolve linting messages in readthedocs.profiles.*
gregmuellegger f85f54e
Resolve linting messages in readthedocs.projects.*
gregmuellegger 937f287
Resolve linting messages in readthedocs.oauth.*
gregmuellegger dc6a2fe
Resolve linting messages in readthedocs.restapi.*
gregmuellegger 94ff257
Resolve linting messages in readthedocs.rtd_tests.*
gregmuellegger 85c69ce
Resolve linting messages in readthedocs.search.*
gregmuellegger cab9805
Resolve linting messages in readthedocs.settings.*
gregmuellegger ab20342
Resolve linting messages in readthedocs.vcs_support.*
gregmuellegger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ pep8: | |
|
||
pylint: | ||
max-line-length: 100 | ||
disable: | ||
- logging-format-interpolation | ||
|
||
mccabe: | ||
run: false | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
from rest_framework.authentication import SessionAuthentication | ||
|
||
|
||
class UnsafeSessionAuthentication(SessionAuthentication): | ||
|
||
def authenticate(self, request): | ||
http_request = request._request | ||
user = getattr(http_request, 'user', None) | ||
|
||
if not user or not user.is_active: | ||
return None | ||
return None | ||
|
||
return (user, None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 feels un-djangoy -- have they suggested doing this now, or is this just to make the linter happy?
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.
Also seems there are a bunch of other places where we're doing it and it isn't alerting. Is it special casing Django model's and forms, but not the api stuff?
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.
The linter complains if python old-style classes are used. Django makes the
Meta
classes into new style classes automatically since this ticket: https://code.djangoproject.com/ticket/7342The restframework however does not. So that's why we made them new-styles classes here by hand. I think of it as "future-proofing" as all classes will be new style classes in Python 3, so we do some testing in that regard here if we make the switch now.