swh-pipeline: Execute all code quality checks instead of just flake8
Prefer to rely on pre-commit
to run all code quality checks in order
to also benefit from black
, codespell
and isort
checks.
This will enforce newly introduced code to pass those checks and force external contributors to install the pre-commit hooks.
I tested the changes in docker and also processed all swh repositories to fix failing checks after the recent version bumps of code quality tools in pre-commit configuration.
Merge request reports
Activity
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #408 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.Currently, configuration for
black
andflake8
can also be found intox.ini
files:[testenv:black] skip_install = true deps = black==24.8.0 commands = {envpython} -m black --check swh [testenv:flake8] skip_install = true deps = flake8==7.1.1 flake8-bugbear==24.4.26 pycodestyle==2.12.1 commands = {envpython} -m flake8
We could indeed remove them after these changes as these tox environments are not (black) or will no longer (flake8) be executed by Jenkins.
Edited by Antoine Lambert
added 1 commit
- 4868f37b - swh-pipeline: Execute all code quality checks instead of just flake8
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #409 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.added 4 commits
-
4868f37b...ac9467b1 - 3 commits from branch
swh/infra/ci-cd:master
- bef17d31 - swh-pipeline: Execute all code quality checks instead of just flake8
-
4868f37b...ac9467b1 - 3 commits from branch
Running pre-commit should happen before rust building, shouldn't it? (cc. @vlorentz)
Could we make the skip list configurable in the job template yaml? We have a couple of modules with extra checks that we might want to be able disable.
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #418 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.added 1 commit
- c567576a - swh-pipeline: Execute all code quality checks instead of just flake8
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #420 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.added 1 commit
- 70b16a66 - swh-pipeline: Execute all code quality checks instead of just flake8
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #421 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.cc. @vlorentz, is there a reason to pick one or the other?
there isn't. they both start a build phase that is mutually exclusive, but Cargo manages locks itself, so it should be fine to run Clippy in parallel with the Rust tests. (and even save us some time on the parallelizable phase)
Edited by vlorentzBut it is already executed by the Rust tests step no ?
Edited by Antoine Lambert
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #423 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.Jenkins job jenkins-tools/swh-jenkins-jobs-builder #426 succeeded .
See Console Output, Blue Ocean and Coverage Report for more details.