Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
align-left

GitHub Action

clang-format lint

v0.4 Pre-release

clang-format lint

align-left

clang-format lint

Github Action that check if code is formatted correctly using clang-format

Installation

Copy and paste the following snippet into your .yml file.

              

- name: clang-format lint

uses: DoozyX/clang-format-lint-action@v0.4

Learn more about this action in DoozyX/clang-format-lint-action

Choose a version

clang-format lint action

This action checks if the source code matches the .clang-format file.

Inputs

source

Where the source files are located.
Default: '.' (current folder)
Example: './src'

exclude

What folder should be excluded from format checking.
Default: 'none'
Example: './third_party'

extensions

What filename extensions should be used for format checking.
Default: 'c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx'
Example: 'cpp,h'

Example usage

name: test-clang-format

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: DoozyX/clang-format-lint-action@v0.3.1
      with:
        source: '.'
        exclude: './third_party'
        extensions: 'h,cpp'