Skip to content
edit-3

GitHub Action

C++ Style Check

v1 Latest version

C++ Style Check

edit-3

C++ Style Check

Runs C++ style check with Uncrustify

Installation

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

              

- name: C++ Style Check

uses: coleaeason/actions-uncrustify@v1

Learn more about this action in coleaeason/actions-uncrustify

Choose a version

Uncrustify C++ Github Action

Runs an uncrustify config against C++ implementation and header files in a given repo.

The script looks for the following file endings:

  • .cpp
  • .cxx
  • .h
  • .hpp

Only runs on files that have been added or modified in a given commit.

Example configurations

Basic:

on: [ pull_request ]

jobs:
  cpp_style_check:
    runs-on: ubuntu-latest
    name: Check C++ Style
    steps:
    - name: Checkout this commit
      uses: actions/checkout@v2
    - name: Run style checks
      uses: coleaeason/actions-uncrustify@v1

Use a specific configuration file via input:

on: [ pull_request ]

jobs:
  cpp_style_check:
    runs-on: ubuntu-latest
    name: Check C++ Style
    steps:
    - name: Checkout this commit
      uses: actions/checkout@v2
    - name: Run style checks
      uses: coleaeason/actions-uncrustify@v1
      with: 
        configPath: 'myConfig.cfg'