This GitHub Action checks consistent of the pushed source code with ITK's Coding Style as specified by its .clang-format style configuration file.
Add the following configuration to your project's repository at, e.g., .github/workflows/clang-format-linter.yml.
on: [push,pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master
The linter check will fail on a pull request if style changes are required.
When used with ITKApplyClangFormatAction, a custom error can be provided,
- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master
with:
error-message: 'Code is inconsistent with ITK Coding Style. Add the *action:ApplyClangFormat* PR label to correct.'