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

Conversation

agjohnson
Copy link
Contributor

This increases prospector base profile to medium strictness, enables pep257,
and adds some additional pylint rules to filter out docstring related failures.
This limits docstrings to methods/classes less than 10 lines, which should be
readable already. Docstrings wouldn't hurt in this case of course, but we won't
require them on everything.

@agjohnson agjohnson added Needed: design decision A core team decision is required PR: work in progress Pull request is not ready for full review labels Aug 21, 2015
@agjohnson agjohnson added this to the Cleanup milestone Aug 21, 2015
@agjohnson
Copy link
Contributor Author

Only 1072 errors, 🍰

@agjohnson
Copy link
Contributor Author

Down to 983 failures with more lenient rules around docstring required construct length. This number is inflated as it includes the fixes to projects/ in #1580, which would bring this down to ~800 failures.

@ericholscher
Copy link
Member

Looks like this is mostly up to date with where we are currently. I've repushed it w/ a merge from master, to see where we are :)

@agjohnson
Copy link
Contributor Author

There are a couple of new additions that we should target here -- a recent PEP now specifies that class should not have a space between class definition in docstring, conflicting with an older PEP that states otherwise.

I've been using this profile locally, by overriding the default with my vim settings. That's a great way to work on this incrementally until we're ready to take more chunks off.

@ericholscher
Copy link
Member

Adding a few exceptions and turning pep257 off gets us down to ~200 mostly
valid errors (unused imports & arguments, etc)

On Fri, Jan 15, 2016 at 11:36 AM, Anthony [email protected] wrote:

There are a couple of new additions that we should target here -- a recent
PEP now specifies that class should not have a space between class
definition in docstring, conflicting with an older PEP that states
otherwise.

I've been using this profile locally, by overriding the default with my
vim settings. That's a great way to work on this incrementally until we're
ready to take more chunks off.


Reply to this email directly or view it on GitHub
#1581 (comment)
.

Eric Holscher
Maker of the internet residing in Portland, Oregon
http://ericholscher.com

@ericholscher
Copy link
Member

Would be worth trying to get this up to medium, at least for the unused import checks -- I generally delete them when I find them, but would be good to have in CI.

@agjohnson
Copy link
Contributor Author

I'd rather keep pep257 and attack this incrementally, pep257 has useful requirements.

A better option is to add the pylint options to the prospector config manually, starting with missing imports.

@agjohnson agjohnson force-pushed the lint-raise-profile branch from 49624cb to 862d8a2 Compare March 21, 2017 18:39
@agjohnson
Copy link
Contributor Author

Okay, I'm making this a thing. I've added a secondary file and a secondary pass to prospector. The secondary pass uses path exclusion, so we can slowly bring in paths during cleanup.

@agjohnson agjohnson requested a review from ericholscher March 21, 2017 19:03
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Could probably use a bit of context in the prospector-more file as to what it's doing and why it's there, but looks like a good way to get this PR merged and on a path forward :)


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.

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.

@ericholscher
Copy link
Member

@agjohnson this ready to merge?

@ericholscher ericholscher merged commit f5d5081 into master Apr 17, 2017
@ericholscher ericholscher removed Needed: design decision A core team decision is required PR: work in progress Pull request is not ready for full review labels Apr 17, 2017
@agjohnson agjohnson deleted the lint-raise-profile branch April 17, 2017 21:34
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