Skip to content

Commit

Permalink
add ocamlformat auto fix in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Khady committed Oct 19, 2024
1 parent d93bb80 commit 421f6fe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ jobs:
- name: Lint fmt
uses: ocaml/setup-ocaml/lint-fmt@v3

- name: Format code
run: |
git ls-files '*.ml' '*.mli' | xargs opam exec -- ocamlformat --inplace
- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: Commit and push changes
if: ${{ steps.git-check.outputs.modified == 'true' }}
run: |
git config --global user.name "Automated ocamlformat GitHub action, developed by robur.coop"
git config --global user.email "autoformat@robur.coop"
git add -A
git commit -m "formatted code"
git push
lint-opam:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 421f6fe

Please sign in to comment.