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

Replace pylint with flake8 plugins #284

Closed
santisoler opened this issue Nov 17, 2021 · 2 comments · Fixed by #285
Closed

Replace pylint with flake8 plugins #284

santisoler opened this issue Nov 17, 2021 · 2 comments · Fixed by #285
Labels
maintenance A maintenance task to improve development

Comments

@santisoler
Copy link
Member

santisoler commented Nov 17, 2021

We've been using pylint for a long time to help us improve the quality of our code.
Nevertheless, it's not new that meeting all its requirements is a very demanding task: some of its complains are very useful (unused imports, unused variables, too long functions, etc), but there are a lot more that we usually decide to ignore. The amount of ignored complains is not small: I think we need to add pylint: disable=... comments on every PR we open. See #283 as a recent example.

So it might be better to go with a better alternative: one that is faster to run, less strict and that allows us to control which types of check we want to run and which don't.
A good alternative would be to use flake8 extensions that take care of specific checks.

I'll leave a list of possible candidates, so feel free to add any extensions you think useful:

Discarded:

  • darglint: checks whether a docstring's description matches the actual function/method implementation
    • (takes too much time to run)
  • flake8-tidy-imports: write tidier imports.
    • (not available through conda)
  • flake8-isort: Use isort to check if the imports on your python files are sorted the way you expect.
    • (we will use isort, but we don't need to list all its complains, we just want it to solve them)
  • flake8-black: Run black --check from within flake8 ecosystem.
    • (same as for flake8-isort)
  • flake8-functions-names: provide better naming for functions.
    • (doesn't offer major features)
  • flake8-requirements: checks/validates package import requirements. It reports missing and/or not used project direct dependencies.
    • (not available through conda)
  • flake8-eradicate: find commented out (or so called "dead") code.
    • (the version available through conda is olddated)
  • flake8-unused-arguments
    • (not available through conda)

The awesome-flake8-extensions is a good place for looking for flake8 extensions.

@santisoler santisoler added the maintenance A maintenance task to improve development label Nov 17, 2021
@leouieda
Copy link
Member

Maybe this one as well: https://github.com/PyCQA/flake8-bugbear

@santisoler
Copy link
Member Author

santisoler commented Nov 19, 2021

After the 2021-11-19 Development Call we decided not to include any flake8 extension that isn't available through conda.
Besides, we decided that isort is a good tool to incorporate, although we really don't want to include flake8-isort: since isort is capable of solving their own issues, a simple make format would solve them, without the need of flake8 to list them all.
The same goes for flake8-black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance A maintenance task to improve development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants