FAQ | This is a LIVE service | Changelog

Add dedicated pre-commit job

pre-commit is a tool that runs checks and fixes locally, giving very fast feedback. When using it we also want to run it in the CI to ensure everyone is running it locally (or manually running the checks/fixes) and that merge events don't break rules (e.g. auto-merges can break black formatting).

Running it as it's own job is beneficial for developer feedback as the checks are in the seconds range unlike tests which tend to be in the minutes range.

This is (soon to be) running in the lab allocator project and this MR shows the current job in .gitlab-ci.yml:

Notable desirable changes from the lab allocator job:

I would also suggest moving the contents of the current .gitlab-ci.yml in the web boilerplate into a new file in ci-templates named something like python-ci.yml. The boilerplate can then just call include:... python-ci.yml and we can pin that include to a major version.

Edited by Ed Kirk