Add editorconfig #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Check code formatting" | |
permissions: | |
contents: read | |
on: pull_request | |
jobs: | |
clang-format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch source | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
**/*.{h,c,cpp} | |
separator: " " | |
- name: List changed files | |
env: | |
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
echo "Changed files:" | |
echo "$CHANGED_FILES" | |
- name: Install clang-format | |
uses: aminya/setup-cpp@v1 | |
with: | |
clangformat: true | |
- name: Check format | |
env: | |
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
clang-format --dry-run --style=file --Werror --verbose $CHANGED_FILES |