Skip to content
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

Iteratively enable flake8 checks #1116

Closed
StanczakDominik opened this issue Apr 19, 2021 · 2 comments · Fixed by #2170
Closed

Iteratively enable flake8 checks #1116

StanczakDominik opened this issue Apr 19, 2021 · 2 comments · Fixed by #2170
Labels
CI Related to continuous integration good first issue Good first contributions for new contributors help wanted Unassigned issues that would benefit from assistance or contributions needed from the community linters For linters (e.g., flake8, ruff) and autoformatters (e.g., ruff, black, isort, Sourcery) Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python

Comments

@StanczakDominik
Copy link
Member

#1062 brought back flake8 linter checks, but kept most of them disabled. There are a bunch of them in setup.cfg:

PlasmaPy/setup.cfg

Lines 96 to 185 in 4a71ade

[flake8]
convention = numpy
# Checks marked as TODO should be eventually enabled,
# but are failing right now. These are *great*
# first contributions. ;)
# Checks not marked by TODO *maybe* should be
# eventually enabled ― ask!
extend-ignore =
# TODO D100: Missing docstring in public module
D100,
# TODO D102: Missing docstring in public method
D102,
# TODO D103: Missing docstring in public function
D103,
# TODO D104: Missing docstring in public package
D104,
D105,
D107,
# TODO D200: One-line docstring should fit on one line with quotes
D200,
# Ignoring D202 allows blank lines to be put on either side of code "paragraphs" at the beginning of a function.
D202,
# D205 and D400 are ignored to allow the "one-liner" to exceed one
# line, which is sometimes necessary for even concise descriptions of plasma
# physics functions and classes.
D205,
# TODO D210: No whitespaces allowed surrounding docstring text
D210,
# TODO D301: Use r""" if any backslashes in a docstring
D301,
# D302 is unnecessary as we are using Python 3.6+.
D302,
# D205 and D400 are ignored to allow the "one-liner" to exceed one
# line, which is sometimes necessary for even concise descriptions of plasma
# physics functions and classes.
D400,
# TODO D401: First line should be in imperative mood
D401,
# D403: First word of the first line should be properly capitalized ('Latex', not 'LaTeX') # Dominik: good job, pydocstyle /s
D403,
# TODO D407: Missing dashed underline after section ('References')
D407,
# TODO D409: Section underline should match the length of its name (Expected 5 dashes in section 'Notes', got 10)
D409,
# TODO D412: No blank lines allowed between a section header and its content
D412
# E203 something something whitespace? TODO check again
E203,
E501,
# TODO E712 comparison to False should be if cond is False or if not cond
E712,
# TODO E713 test for membership should be 'not in'
E713,
# E731 do not assign a lambda, use a def - Dominik: disagreed, lambdas have uses
E731,
F401,
# TODO star imports and undefined variables
F403,
F405,
# all TODO from here on out, probably
F541,
# W605 invalid escape sequence,
W605,
RST210,
RST213,
RST306,
RST902,
exclude =
extern,
sphinx,
*test*,
*parsetab.py,
conftest.py,
docs/conf.py,
setup.py,
.jupyter
rst-roles =
# TODO look into these
attr,
class,
func,
data,
exc,
file,
meth,
mod
rst-directives =
deprecated,
nbgallery,
todo

It'd be nice to have them back. This would mean, for any brave soul willing to undertake this, for every check marked as TODO (and probably some others, too):

  • enable the check again by removing it from the exclude list;
  • fix all the lint errors that flake8 (in the tests section) starts throwing at you;
  • continue down the list for as long as you'd like.

This is, admittedly, not exciting, but quite helpful and simple to execute; would be great for a new contributor.

@StanczakDominik StanczakDominik added good first issue Good first contributions for new contributors help wanted Unassigned issues that would benefit from assistance or contributions needed from the community Project Lv2 | Beginner CI Related to continuous integration labels Apr 19, 2021
@StanczakDominik StanczakDominik changed the title Iteratively enable flake8 checks in Iteratively enable flake8 checks Apr 19, 2021
@aksalcido
Copy link
Contributor

Hello Dominik, I emailed you and I would like to work on this :)

@StanczakDominik
Copy link
Member Author

Go right ahead! 😄

@aksalcido aksalcido mentioned this issue Apr 30, 2021
3 tasks
@github-actions github-actions bot added the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label Jul 20, 2021
@namurphy namurphy added Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python and removed Project Lv2 | Beginner labels Mar 9, 2023
@namurphy namurphy removed the Stale Dormant issues & PRs which will be automatically closed if the label is not removed. label May 12, 2023
@namurphy namurphy added the linters For linters (e.g., flake8, ruff) and autoformatters (e.g., ruff, black, isort, Sourcery) label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to continuous integration good first issue Good first contributions for new contributors help wanted Unassigned issues that would benefit from assistance or contributions needed from the community linters For linters (e.g., flake8, ruff) and autoformatters (e.g., ruff, black, isort, Sourcery) Python Lv2 | Intermediate Issues that require a medium amount of knowledge of Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants