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

GitHub Action

clang-format Code Formatter

v1.2

clang-format Code Formatter

play

clang-format Code Formatter

Runs clang-format on your source code so your users do not have to

Installation

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

              

- name: clang-format Code Formatter

uses: IvanLudvig/[email protected]

Learn more about this action in IvanLudvig/clang-format-action

Choose a version

Clang format Github action

This project can be used to run clang-format on every push using Github actions.

Usage

For a more detailed installation guide look there

Create a formatter.yml file in .github/workflows/. Paste this code into the file:

on: push
name: clang-format Code Formatter
jobs:
  lint:
    name: clang-format Code Formatter
    runs-on: ubuntu-latest
    steps:
    - name: Clang Code Formatter
      uses: ivanludvig/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}