jupyter-server / team-compass

A repository for team discussion, syncing, and meeting notes.
https://jupyter-server-team-compass.readthedocs.io
BSD 3-Clause "New" or "Revised" License
13 stars 7 forks source link

dropping flake8 #36

Closed dlqqq closed 1 year ago

dlqqq commented 1 year ago

cc @blink1073

While developing a new server extension using the server extension cookiecutter, I noticed that flake8 was failing in the pipeline but not locally. Looking more closely, it was because the flake8 precommit step was isolated into a "manual" hook stage, which, confusingly, doesn't actually run when you manually invoke pre-commit run --all-files.

Then, when I correctly specified the manual hook stage via pre-commit run --all-files --hook-stage=manual, the errors were not being automatically fixed! I had to go file by file, line by line, and correct them myself.

This got me thinking: why use flake8 in precommit at all? We already use black as a linter. There doesn't seem to be any particular value in having two linters running in tandem. Using both in tandem creates weird incompatibilities that force the presence of additional configuration to mitigate them (see .flake8 file in jupyter-server repo). Furthermore, issues and responses from the lead maintainer (https://github.com/PyCQA/flake8/issues/234) have me a bit concerned about the sustainability of flake8.

To fix this, ideally we would:

blink1073 commented 1 year ago

Black is a formatter, not a linter. Most linters, pylint included, cannot just fix the lint they find. While I agree the .flake8 file is annoying, flake8 is providing us value.