File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Store files that are about to be committed
4+ staged_files=$( git diff --cached --name-only --diff-filter=d | grep .ex$)
5+
6+ if [ -n " $staged_files " ]; then
7+ echo " Running mix format on staged Elixir files..."
8+
9+ # Run mix format
10+ mix format
11+
12+ # Add the formatted files back to staging
13+ echo " $staged_files " | while read file; do
14+ if [ -f " $file " ]; then
15+ git add " $file "
16+ fi
17+ done
18+ fi
19+
20+ # Run format check to ensure everything is formatted
21+ mix format --check-formatted
22+ if [ $? -ne 0 ]; then
23+ echo " ❌ Code must be properly formatted before committing."
24+ echo " Please stage the formatting changes and try again."
25+ exit 1
26+ fi
27+
28+ echo " ✅ Code formatting check passed."
29+ exit 0
Original file line number Diff line number Diff line change 1818 - name : Set up Elixir
1919 uses : erlef/setup-beam@v1
2020 with :
21- elixir-version : ' 1.14 .x'
22- otp-version : ' 25 .x'
21+ elixir-version : ' 1.18 .x'
22+ otp-version : ' 27 .x'
2323
2424 - name : Cache deps
2525 uses : actions/cache@v3
Original file line number Diff line number Diff line change 1515 - name : Set up Elixir
1616 uses : erlef/setup-beam@v1
1717 with :
18- elixir-version : ' 1.14 .x'
19- otp-version : ' 25 .x'
18+ elixir-version : ' 1.18 .x'
19+ otp-version : ' 27 .x'
2020
2121 - name : Install dependencies
2222 run : mix deps.get
You can’t perform that action at this time.
0 commit comments