Skip to content

Commit

Permalink
Format also files in test/
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Jun 25, 2024
1 parent 02ef069 commit f08aec4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/rebar3-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

REBAR=$1

ERLS=$(git grep --name-only @format-begin src/)
FORMAT()
{
FPATH=$1
ERLS=$(git grep --name-only @format-begin "$FPATH"/)

for ERL in $ERLS; do
csplit --quiet --prefix=$ERL-format- $ERL /@format-/ "{*}"
done

EFMTS=$(find src/*-format-* -type f -exec grep --files-with-matches "@format-begin" '{}' ';')
EFMTS=$(find "$FPATH"/*-format-* -type f -exec grep --files-with-matches "@format-begin" '{}' ';')
EFMTS2=""
for EFMT in $EFMTS; do
EFMTS2="$EFMTS2 --files $EFMT"
Expand All @@ -32,3 +35,7 @@ for ERL in $ERLS; do
rm $SPLIT
done
done
}

FORMAT src
FORMAT test

0 comments on commit f08aec4

Please sign in to comment.