1 Star 0 Fork 0

mirrors_cocos-creator / clang-format-action

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

clang-format GitHub Action

License

This repository holds a basic GitHub Action for running clang-format.

It primarily targets the HSF/prmon project. However, it's generic enough to be used in any project and created using the instructions detailed here.

In a nutshell, it creates a Docker container, based on ubuntu:focal, with only git and clang-format installed on top of it. Within the container, we go into the project directory, run clang-format over all relevant files (with extension c,cpp,cxx,h,hpp), commit and push the changes to the relevant branch (if needed).

Inputs

style

Required The name of the style to be used in formatting. Default is Google.

Outputs

message

The message containing information about the result of the action.

Usage

# Name of the workflow
name: Clang-Format

# Controls when the action will run. Triggers the workflow on push for all branches
on: push

# Defines the main job where we checkout our code, run clang-format
# and commit changes
jobs:
  clang-format:
    runs-on: ubuntu-latest
    steps:
    # Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
    - uses: actions/checkout@v2

    # Applies clang-format to all C/C++ files w/ the specified style
    - name: Apply clang-format
      id: formatting
      uses: amete/clang-format-action@v0.2
      with:
        style: 'Google'

    # Gets and prints the output message
    - name: Get the output message
      run: echo "${{ steps.formatting.outputs.message }}"

Repository Comments ( 0 )

Sign in for post a comment

About

No description expand collapse
Shell and 2 more languages
Apache-2.0
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
1
https://toscode.gitee.com/mirrors_cocos-creator/clang-format-action.git
git@toscode.gitee.com:mirrors_cocos-creator/clang-format-action.git
mirrors_cocos-creator
clang-format-action
clang-format-action
master

Search

141041 ab9339c7 1850385 141043 25c028d5 1850385