commontk / CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
https://commontk.org
Apache License 2.0
827 stars 481 forks source link

ENH: Add GitHub Actions workflow for running "pre-commit" #1170

Closed jcfr closed 5 months ago

jcfr commented 5 months ago

This pull-request adds workflow leveraging pre-commit, a framework for managing and maintaining pre-commit hooks.

[!IMPORTANT] For now, this will only report info to developers after the PR is submitted. There are no changes in the hook setup locally yet.

See https://pre-commit.com/ and https://github.com/pre-commit/action

Running the pre-commit locally can be done using the following command:

pre-commit run --all-files

The hooks enabled in the "pre-commit-config.yaml" configuration file are:


To allow a gradual improvement of the code base while carefully reviewing each changes, exceptions for all issues reported by locally running the following command are listed in .flake8 configuration files:

  pre-commit run --all-files

It is based from similar updates integrated in Slicer through https://github.com/Slicer/Slicer/pull/6262 themselves adapted from prior work done by @henryiii in https://github.com/scikit-build/scikit-build and https://scikit-hep.org/developer/style