What's up with the flake8 failures currently on the OctoPrint repository?
(OctoPrint) ryan@linda:~/git/OctoPrint{maintenance}$ pre-commit run --hook-stage manual --all-files
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check for case conflicts.................................................Passed
check json...............................................................Passed
check yaml...............................................................Passed
check toml...............................................................Passed
check for merge conflicts................................................Passed
fix python encoding pragma...............................................Passed
pyupgrade................................................................Passed
OctoPrint codemod: batch.................................................Passed
isort....................................................................Passed
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
src/octoprint/schema/config/temperature.py:2:104: B950 line too long (103 > 90 characters)
src/octoprint/printer/profile.py:45:118: B950 line too long (117 > 90 characters)
src/octoprint/printer/profile.py:85:109: B950 line too long (108 > 90 characters)
[...]
src/octoprint/server/views.py:1454:1: C901 '_process_template_configs' is too complex (12)
src/octoprint/server/views.py:1484:110: B950 line too long (109 > 90 characters)
src/octoprint/server/views.py:1504:1: C901 '_process_template_config' is too complex (16)
prettier.................................................................Passed
eslint...................................................................Passed
codespell................................................................Passed
The complexity errors are because I have max-complexity = 10
in my ~/.config/flake8
(it sucks that flake8 doesn't have a "ignore user config" option), but the max-line-length is specifically adhering to setup.cfg
:
[flake8]
max-line-length = 90
extend-ignore = E203, E231, E265, E266, E402, E501, E731
select = B,C,E,F,W,T4,B9
exclude =
src/octoprint/vendor
And there are MANY files in the codebase with lengths greater than 90.
Perhaps also related, the GH Actions PR pre-commit job appears broken in a different respect, for example:
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/bin/flake8", line 8, in <module>
sys.exit(main())
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
app.run(argv)
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
self._run(argv)
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run
self.initialize(argv)
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize
self.find_plugins(config_finder)
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins
self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__
self.namespace, local_plugins=local_plugins
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__
self._load_entrypoint_plugins()
File "/home/runner/.cache/pre-commit/repos7xx2qfz/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
eps = importlib_metadata.entry_points().get(self.namespace, ())
AttributeError: 'EntryPoints' object has no attribute 'get'
I just want to make sure I'm not missing something. Are we just in the middle of a black reformat and the code hasn't been chopped to 90 yet, or something similar?