Skip to content

Commit ae7a174

Browse files
committed
Add bin/format, to check for fixable linting errors
1 parent a08094e commit ae7a174

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- uses: pkgxdev/dev@v0
4545
- run: mix deps.get
4646
- run: mix e2e.update_examples_workflow --check
47+
- run: bin/format --check
4748

4849
build:
4950
runs-on: ubuntu-latest

bin/format

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
# This script is used to identify and fix formatting issues.
4+
# It can be run in two modes:
5+
#
6+
# Usage:
7+
# ./bin/format # To update and format the code.
8+
# ./bin/format --check # To check for formatting issues.
9+
10+
if [[ $# -gt 0 && "$1" == "--check" ]]; then
11+
echo "Checking for formatting issues..."
12+
mix e2e.update_examples_workflow --check
13+
mix format --check-formatted
14+
else
15+
echo "Fixing formatting issues..."
16+
mix e2e.update_examples_workflow
17+
mix format
18+
fi

0 commit comments

Comments
 (0)