Skip to content

Commit

Permalink
feat: removing excluded files and not reading folders recursively for…
Browse files Browse the repository at this point in the history
… now
  • Loading branch information
SuperFola committed Sep 22, 2024
1 parent 6df00e7 commit 1d4b0e0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ jobs:
- uses: ArkScript-lang/action-format@master
with:
folder: example
exclude: example/excluded
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ inputs:
folder:
description: 'Folder with .ark files to check'
required: true
exclude:
description: 'Folders to exclude, comma separated'
```

> [!WARNING]
> The folders **MUST NOT** be terminated by a `/`
- **folder**: path to ArkScript files ; will be scanned recursively for `*.ark` files
- **exclude**: list of path to exclude, eg `foo,bar,egg/test`
- **folder**: path to ArkScript files ; will be scanned for `*.ark` files

14 changes: 1 addition & 13 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ inputs:
folder:
description: 'Folder with .ark files to check'
required: true
exclude:
description: 'Folders to exclude, comma separated'

runs:
using: 'composite'
Expand All @@ -24,16 +22,6 @@ runs:
- name: Check
shell: bash
run: |
exclusions=''
if ! [ -z "${{ inputs.exclude }}" ]; then
IFS=',' read -ra EXC <<< "${{ inputs.exclude }}"
for i in "${EXC[@]}"; do
# process "$i"
exclusions="$exclusions -not -path '$i/*'"
done
echo "Exclusions: '$exclusions'"
fi
failures=0
while read -rd $'\0' file; do
if ! ./arkscript --format "$file" --check; then
Expand All @@ -42,7 +30,7 @@ runs:
else
echo "✅ $(basename $file)"
fi
done < <(find "${{ inputs.folder }}" -type f -name "*.ark" $exclusions -print0)
done < <(find "${{ inputs.folder }}" -type f -name "*.ark" -maxdepth 1 -print0)
echo "$failures file(s) need to be formatted"
[ $failures -gt 0 ] && exit 1 || exit 0

0 comments on commit 1d4b0e0

Please sign in to comment.