Skip to content

Use pre-commit to run code quality checks

Detailed Description

Use pre-commit to run new/existing code quality checks as Git pre-commit hooks:

  • YAML file syntax (replaces lint:coala)
  • Makefile indentation (replaces lint:coala)
  • Sorting .gitattributes (new)
  • Sorting/organising .gitignore (partly replaces lint:gitignore)
  • Updating .mailmap, AUTHORS (replaces make update-authors, lint:authors)
  • Pretty-formatting code (replaces make pretty, lint:pretty)
  • Checks on executable files (replaces lint:execute)

A single lint:pre-commit job now runs all the above tests, in case the user didn't run them locally before committing.

CONTRIBUTING.md has been updated with pre-commit install instructions. In particular the user must run

pre-commit install

once to install the hooks.

The code quality scripts are in a separate repository (https://git.ligo.org/lscsoft/lalsuite-code-quality) which allows pre-commit to download and install them as a separate virtual environment; the user does not need to install them manually or worry about dependencies.

API Changes

  • These changes do not modify the API.
  • These changes are backwards compatible.
  • These changes are backwards incompatible.

For examples of changes that do not modify the API and/or are considered backwards (in)compatible, please see the contributing guide.

Justification for Backwards Incompatible Changes

n/a

Review Status

n/a

Merge request reports

Loading