-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: adding an arkscript formatting step
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: 'Format check ArkScript code' | ||
description: 'Given a folder, find all .ark files and check that they are correctly formatted' | ||
inputs: | ||
folder: | ||
description: 'Folder with .ark files to check' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Check | ||
shell: sh | ||
run: | | ||
failures=0 | ||
find "${{ inputs.folder }}" -type f -name "*.ark" -print0 | while read -d $'\0' file | ||
do | ||
arkscript --format "$file" --check || echo "❌ $file is not formatted correctly" | ||
failures=1 | ||
done | ||
echo $failures | ||
if [ $failures -gt 0 ]; then | ||
exit 1 | ||
fi |