-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (44 loc) · 1.72 KB
/
Copy pathformat.yml
File metadata and controls
47 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Formatting
on: [pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: "1"
- name: Install JuliaFormatter
run: julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
- name: Check formatting
run: |
julia -e 'using JuliaFormatter; format(".")'
# Check if any files were modified
if [ -n "$(git diff --name-only)" ]; then
echo ""
echo "============================================================"
echo "ERROR: The following files are not properly formatted:"
echo "============================================================"
git diff --name-only
echo ""
echo "Required changes:"
echo "------------------------------------------------------------"
git diff --color=always
echo ""
echo "============================================================"
echo "To fix locally, run:"
echo ""
echo " julia -e 'using Pkg; Pkg.add(\"JuliaFormatter\"); using JuliaFormatter; format(\".\")'"
echo "============================================================"
exit 1
else
echo "All files are properly formatted"
fi
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.18.0
with:
clang-format-version: 15
check-path: deps/src