Skip to content

Example of increased strictness on linting #1581

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
Apr 17, 2017
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
47 changes: 47 additions & 0 deletions prospector-more.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
inherits: prospector

strictness: medium

ignore-paths:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should put a comment here or something inviting folks to remove a directory and fix the errors going forward, perhaps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more visible as an issue, i think there is already one open.

- docs/
- acl/
- api/
- betterversion/
- bookmarks/
- builds/
- cdn/
- comments/
- core/
- djangome/
- doc_builder/
- donate/
- gold/
- locale/
- notifications/
- oauth/
- payments/
- privacy/
- profiles/
- projects/
- redirects/
- restapi/
- rtd/
- rtd_tests/
- search/
- settings/
- static/
- tastyapi/
- templates/
- vcs_support/

pylint:
options:
docstring-min-length: 20
dummy-variables-rgx: '_$|__$|dummy'
max-line-length: 100
disable:
- logging-format-interpolation
- too-many-arguments

pep257:
run: true
12 changes: 4 additions & 8 deletions prospector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uses:
- celery

ignore-paths:
- docs
- docs/

ignore-patterns:
- /migrations/
Expand All @@ -25,19 +25,15 @@ pylint:
disable:
- logging-format-interpolation

pyflakes:
disable:
- F999

mccabe:
run: false

pep257:
run: false
disable:
- D105
- D211
- D104
- D105
- D211
- D104

pyflakes:
disable:
Expand Down
2 changes: 2 additions & 0 deletions readthedocs/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Common constants"""

from readthedocs.builds.version_slug import VERSION_SLUG_REGEX
from readthedocs.projects.constants import LANGUAGES_REGEX, PROJECT_SLUG_REGEX

Expand Down
1 change: 1 addition & 0 deletions readthedocs/integrations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def from_exchange(self, req, resp, related_object, payload=None):
return obj

def delete_limit(self, related_object, limit=10):
# pylint: disable=protected-access
queryset = self.filter(
content_type=ContentType.objects.get(
app_label=related_object._meta.app_label,
Expand Down
4 changes: 3 additions & 1 deletion readthedocs/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""WSGI application helper"""

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.postgres")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.dev")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a change we don't want in this PR?

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 lumped this in with cleanup on this file, settings.postgres is long gone.


# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ commands =
[testenv:lint]
deps = -r{toxinidir}/requirements/lint.txt
commands =
prospector \
--profile-path={toxinidir} \
--profile=prospector-more \
--die-on-tool-error
prospector \
--profile-path={toxinidir} \
--profile=prospector \
Expand Down