-
Notifications
You must be signed in to change notification settings - Fork 224
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
Migrate pylint settings from .pylintrc to pyproject.toml #1755
Conversation
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.
Just one quick comment for now. I still need to find time to test this locally. Oh, and please remove the exclude .pylintrc
line from MANIFEST.in!
[DESIGN] | ||
|
||
# Maximum number of arguments for function / method. | ||
max-args=10 | ||
|
||
# Maximum number of attributes for a class (see R0902). | ||
max-attributes=10 | ||
|
||
# Maximum number of boolean expressions in an if statement (see R0916). | ||
max-bool-expr=5 | ||
|
||
# Maximum number of branch for function / method body. | ||
max-branches=12 | ||
|
||
# Maximum number of locals for function / method body. | ||
max-locals=15 | ||
|
||
# Maximum number of parents for a class (see R0901). | ||
max-parents=7 | ||
|
||
# Maximum number of public methods for a class (see R0904). | ||
max-public-methods=20 | ||
|
||
# Maximum number of return / yield for function / method body. | ||
max-returns=6 | ||
|
||
# Maximum number of statements in function / method body. | ||
max-statements=50 | ||
|
||
# Minimum number of public methods for a class (see R0903). | ||
min-public-methods=2 |
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.
Do we want to keep any more of these design choices? I think the max-attributes=10 is also a non-default choice according to #484. Feel like there are a few of these we should keep too even though we don't encounter it often.
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 default max-attributes=7
works well for the current main branch. Perhaps we should only change these values when we have to.
Ping @weiji14 and @meghanrjones for review. |
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.
Yep, looks good, no errors running make lint
locally 🎉
…ingTools#1755) * Migrate pylint settings from .pylintrc to pyproject.toml * Disable import-error * Remove .pylintrc from MANIFEST.in * Remove .pylintrc from workflows * Set generated-members to pandas.* * Refactor test_hotspots to avoid E1101 error
Description of proposed changes
Changes in this PR:
.pylintrc
pyproject.toml
import-outside-toplevel
andattribute-defined-outside-init
jobs
to 0 so that pylint can use all available cores (the old value is 4).Fixes #1740.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version