Skip to content

Commit

Permalink
yaml formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KommuSoft committed Aug 15, 2024
1 parent 2b49432 commit 93a49ea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
18 changes: 18 additions & 0 deletions foo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
doe: a deer, a female deer
ray: a drop of golden sun
pi: 3.14159
xmas: true
french-hens: 3
calling-birds:
- huey
- dewey
- louie
- fred
xmas-fifth-day:
calling-birds: four
french-hens: 3
golden-rings: 5
partridges:
count: 1
location: a pear tree
turtle-doves: two
10 changes: 6 additions & 4 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
format () {
pat="$1"
shift
if git ls-files --error-unmatch "$pat"; then
git ls-files "$pat" | xargs "$@"
if git ls-files --error-unmatch "$pat" 2>/dev/null; then
git ls-files "$pat" | xargs -- "$@" --
fi
}

format '*.hs' ormolu
format '*.sql' sqlformat -reindent -s -keywords upper -identifiers lower
format '*.py' python -m isort
format '*.py' python -m black -- -S -q
format '*.py' python3 -m isort --
format '*.py' python3 -m black -- -S -q
format '*.yaml' yamlfmt -w
format '*.yml' yamlfmt -w
4 changes: 1 addition & 3 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

pip install --upgrade black isort


pip install --upgrade black isort yamlfmt

0 comments on commit 93a49ea

Please sign in to comment.