This repository was archived by the owner on Feb 8, 2019. It is now read-only.
Update python files with some moderately aggressive linting.#54
Open
wtokumaru wants to merge 4 commits intochronoscio:masterfrom
wtokumaru:lint
Open
Update python files with some moderately aggressive linting.#54wtokumaru wants to merge 4 commits intochronoscio:masterfrom wtokumaru:lint
wtokumaru wants to merge 4 commits intochronoscio:masterfrom
wtokumaru:lint
Conversation
dwaxe
suggested changes
Oct 14, 2018
project/api/filters.py
Outdated
| ) | ||
|
|
||
| def filter_bounds(self, queryset, field_name, value): | ||
| """Check the geometry.""" |
project/api/filters.py
Outdated
| return queryset.filter(geo__intersects=geom) | ||
|
|
||
| def filter_date(self, queryset, field_name, value): | ||
| """Check the time range.""" |
project/api/models.py
Outdated
| """Manager for the Nation model to handle lookups by url_id.""" | ||
|
|
||
| def get_by_natural_key(self, url_id): | ||
| """Returns attributes by the given url_id.""" |
project/api/models.py
Outdated
| name = models.TextField( | ||
| max_length=100, | ||
| help_text="Canonical name, should not include any epithets, must be unique", | ||
| help_text="Canonical name, which should not include any epithets" |
Contributor
There was a problem hiding this comment.
I don't think we need to conform so strictly to -l 80. We should leave this on one line imo. Also avoid extra migration.
Author
There was a problem hiding this comment.
The split is done elsewhere in the same file already, so it makes sense to me for it to be consistent.
project/api/models.py
Outdated
| super(DiplomaticRelation, self).clean(*args, **kwargs) | ||
|
|
||
| def save(self, *args, **kwargs): | ||
| """Save the DiplomaticRelation data.""" |
project/api/permissions.py
Outdated
| 0, | ||
| re.DOTALL) | ||
| cert = '-----BEGIN CERTIFICATE-----\n' + body + '\n-----END CERTIFICATE-----' | ||
| cert = ('-----BEGIN CERTIFICATE-----\n' + body + |
project/api/serializers.py
Outdated
| ) | ||
|
|
||
| def to_internal_value(self, data): | ||
| """Converts data to GeoJSON.""" |
Contributor
There was a problem hiding this comment.
Describe what the function is actually doing to the data
project/interactivemap/settings.py
Outdated
| AUTH_PASSWORD_VALIDATORS = [ | ||
| { | ||
| 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | ||
| 'NAME': ('django.contrib.auth.password_validation.UserAttribute' |
dwaxe
reviewed
Oct 22, 2018
| history = HistoricalRecords() | ||
|
|
||
| def clean(self, *args, **kwargs): | ||
| def clean(self, *args, **kwargs): # noqa |
Contributor
There was a problem hiding this comment.
Disable the rule thats necessitating these noqa?
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Figured I might as well take care of the excessively long lines triggering lint errors. Not certain about what to put in some of the missing doctsrings so please let me know what they should say. (Bad doctsrings are often worse than none.) Still can not request reviews or add tags. Not certain about when to track migrations so I have a separate commit for the file that changed when I ran migrate.
Obviously we do not need all of this but I figure it might be worth discussion.