git hook setup / CD¶
The FastSurfer team has developed a pre-commit hook script to help implement Continuous Development and Testing. This CI/CD expands on github workflows executing them locally. They require a local uv installation as described for FastSurfer’s Native installation.
Pre-commit Hook¶
The pre-commit hook script will:
Check for trailing white spaces in files
Run ruff to verify python code formatting is valid
Run codespell to check the spelling
Run sphinx-build to rebuild the documentation into
FastSurfer/doc-buildHere, one important caveat for documentation editors is that sphinx-build may fail if the documentation file structure is changed, without first cleaning the autosummary/autodoc-generated files. To do this, delete the following directoryFastSurfer/doc/api/generated.
Installation¶
To install the pre-commit hook, in the FastSurfer directory call
ln -s ../../tools/git-hooks/pre-commit .git/hooks/pre-commit