Skip to content

Commit

Permalink
chore: add check_format.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed Oct 30, 2023
1 parent 9e912b6 commit 18d770a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: check_format

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
check_format:
steps:
- uses: julia-actions/setup-julia@v1
with:
version: 1.8
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install JuliaFormatter
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
- name: Format code
run: |
git clean -f -x -d
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Fail if needs reformatting
run: |
if [[ $(git status --porcelain) ]]; then
echo "please reformat these files:"
git status --porcelain=v1
exit 1
fi

0 comments on commit 18d770a

Please sign in to comment.