Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit abcbe3c

Browse files
author
Michael Lyons
committedFeb 27, 2025·
Add cursory first-line check of test files
1 parent 89402f6 commit abcbe3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎syntax-tests.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,14 @@ link_additional_packages
153153
create_dummy_syntaxes
154154

155155
echo "::group::Checking syntax test filenames"
156-
for path in $(find . -iname syntax_test* | grep -v '/syntax_test_'); do
156+
for path in $(find . -iname syntax_test*); do
157157
file="${path/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}"
158-
echo "::warning file=$file::Syntax test files must begin with 'syntax_test_'"
158+
if echo "$file" | grep -v '/syntax_test_'; then
159+
echo "::warning file=$file::Syntax test filenames must begin with 'syntax_test_'"
160+
fi
161+
if head -n 1 "$path" | grep -vEq '.+\bSYNTAX TEST\b.+".+\.(sublime-syntax|tmLanguage)"'; then
162+
echo "::warning file=$file::Syntax test file format at https://www.sublimetext.com/docs/syntax.html#testing"
163+
fi
159164
done
160165
echo '::endgroup::'
161166

0 commit comments

Comments
 (0)
Please sign in to comment.