Skip to content

Commit

Permalink
Merge pull request #375 from robotology/feature/ci_clang_format
Browse files Browse the repository at this point in the history
Enforce compliance of clang-format style
  • Loading branch information
diegoferigo authored Jul 21, 2021
2 parents cf10032 + 58adbaf commit 50a9662
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Code Style

on:
push:
pull_request:
workflow_dispatch:

jobs:

clang-format:

name: "clang-format"
runs-on: ubuntu-latest

steps:

- name: "🔀 Checkout repository"
uses: actions/checkout@v2

- name: "⬇️️ Install dependencies"
run: sudo apt-get install -y --no-install-recommends colordiff

- name: "📝 Format C++"
uses: diegoferigo/gh-action-clang-format@v0.1
id: format
with:
style: file
pattern: |
*.h
*.cpp
- name: "🔍️ Inspect style diff"
if: failure()
run: printf "${{ steps.format.outputs.diff }}" | colordiff

0 comments on commit 50a9662

Please sign in to comment.