Univention Bugzilla – Bug 52458
enable more linting
Last modified: 2021-02-16 14:35:55 CET
The flake8 linter is currently configured to test only very few things. Configure more source code validation.
You don't mean the flake8 plugin of ucslint, right? Do you have a UCS@school flake8 pipeline?
(In reply to Florian Best from comment #1) > You don't mean the flake8 plugin of ucslint, right? > Do you have a UCS@school flake8 pipeline? We have a *pre-commit hook* that verifies: * Python import sorting (isort) * Python code formatting (black) * Python code style / static checks (flake8) The current flake8 configuration is rather minimal. In the past we wanted to introduce it without to much changes at once. This bug is about activating more checks in flake8.
The git branch dtroeder/52458_more_linting contains 46 commits that enable step by step more flake8 checks and other linters. The last 3 commits (from today) have not yet been reviewed. All commits have been merged to '4.4' and squashed into 1 commit, which was added to the git-hyper-blame ignore list: [4.4 b40ff404a] Bug #52458: enable most flake8 tests and add more linters [4.4 fa6d190fb] Bug #52458: add 'more linters' commit to git-hyper-blame ignore list No packages will be rebuilt.
QA → All OK → Verify Configs → OK Code changes → OK Merge without conflicts → OK git hyperblame → OK as mentioned, the packages are not rebuild.
The cleanup of imports in file ucs-school-import/modules/ucsschool/http_api/import_api/models.py lead to an ImportError from serializers.py, because JOB_SCHEDULED was not imported in models.py anymore (where it was not needed). The import in serializers.py has been fixed and the package rebuilt (it had been build for Bug 52770): [4.4] 9111129ce Bug #52458: fix ImportError after cleanup of imports [4.4] 41c316978 Bug #52458: advisory update
Another failed test (215_import-users_illegal_chars_in_username_v2) from introducing more linting fixed: [4.4 7eb3747cd] Bug #52458: fix ValueError raised by doctest (invalid option: '#') [4.4 333f955a8] Bug #52458: advisory update