Skip to content

YDA-5623: fail workflow if code is not properly formatted #19

YDA-5623: fail workflow if code is not properly formatted

YDA-5623: fail workflow if code is not properly formatted #19

name: linter-irods-clang-format
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install ClangFormat
run: |
sudo apt-get install -y clang-format
- name: Run ClangFormat
run: |
echo "warnings=$(clang-format -n src/* | wc -l)" >> "$GITHUB_ENV"
- run: |
echo "Source code needs to be formatted! ${{ env.warnings }}";
exit 1
if: ${{ env.warnings }} != '0'