Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update syntax test output parsing for v4181 #25

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7262436
Adjust error message parsing for new syntax tests
Feb 11, 2025
e2d366a
Temporarily enable action on push
Feb 11, 2025
03f59cc
Temporarily disable action on cron
Feb 11, 2025
9e84e79
Temporarily make the build unattainable
Feb 11, 2025
b4933e5
Add some debug messages
Feb 11, 2025
2f9f9bd
Temporarily disable most of the tests
Feb 11, 2025
869405c
Fix echo for new test output
Feb 11, 2025
524ec75
Add some debug trash
Feb 11, 2025
3ba2433
Use no-IFS line for echo
Feb 11, 2025
c18e2db
Explicitly drop IFS
Feb 11, 2025
4aadc85
Cleanup line formatting
Feb 11, 2025
b049d4b
Add more debug
Feb 11, 2025
1fb127a
Fix new line test
Feb 11, 2025
c49b3ca
Trim error text
Feb 11, 2025
8f3a725
Revert "Temporarily make the build unattainable"
Feb 11, 2025
ec7841a
Consolidate if statements
Feb 11, 2025
7b74f3d
Revert "Consolidate if statements"
Feb 11, 2025
e9c1df5
Move the IFS assignment carefully
Feb 11, 2025
300e6b0
Move new format first
Feb 11, 2025
c893650
Read log type
Feb 11, 2025
8b21661
Fixup read log type
Feb 11, 2025
e3dc260
Fixup log echo
Feb 11, 2025
d68e37a
Test reading message twice
Feb 11, 2025
ca849e1
Merge both old and new formats
Feb 11, 2025
3a72bb1
Use math expansion for version test
Feb 11, 2025
7d66cdf
Add debug statements
Feb 11, 2025
5f22e57
Add another debug statement
Feb 11, 2025
e468f88
Fix file path rewrite
Feb 11, 2025
de2a370
Revert "Temporarily disable most of the tests"
Feb 11, 2025
a3da7f2
Remove debug statements
Feb 11, 2025
429082a
Revert "Temporarily disable action on cron"
Feb 11, 2025
97adccc
Revert "Temporarily enable action on push"
Feb 11, 2025
655b88c
Don't rewrite IFS as often
Feb 11, 2025
7773a90
Set IFS back to normal, just in case
Feb 13, 2025
6d02fb1
Experiment with single-command IFS
Feb 16, 2025
ef9a3b4
Fix version number
michaelblyons Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions syntax-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,28 @@ create_dummy_syntaxes
# but we may not be able to rewrite the original root path.
# https://github.com/rbialon/flake8-annotations/blob/master/index.js
echo 'Running binary'

"$folder/syntax_tests" \
| while read -r line; do
| while IFS='' read -r line; do
echo "$line"
# /syntax_tests/Data/Packages/syntax-test-action/test/defpkg/syntax_test_test:7:1: [source.python constant.language] does not match scope [text.test]
### Before 4181
# /home/runner/work/syntax-test-action/syntax_tests/Data/Packages/syntax-test-action/test/defpkg/syntax_test_test:7:1: [source.python constant.language] does not match scope [text.test]

### Since 4181
# /home/runner/work/syntax-test-action/syntax_tests/Data/Packages/syntax-test-action/syntax_test_js.js:8:8
# error: scope does not match
# 8 | param
# 9 | // ^^^^^ - variable.parameter.function.js
# | ^^^^^ these locations did not match
# actual:
# | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js
if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then
IFS=$':' read -r path row col message <<< "$line"
file="${path/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}"
if (( $build >= 4181 )); then
IFS=$':' read -r logtype message
fi
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
echo "::error file=$file,line=$row,col=$col::${message# }"
echo "::${logtype:-error} file=$file,line=$row,col=$col::${message# }"
fi
done
5 changes: 5 additions & 0 deletions test/st3/syntax_test_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
// Negate to get the inverse result.

abc = (
param

Check failure on line 8 in test/st3/syntax_test_js.js

View workflow job for this annotation

GitHub Actions / Error on purpose

scope does not match
// ^^^^^ - variable.parameter.function.js
) => 1 + 2

xyz = (
param

Check failure on line 13 in test/st3/syntax_test_js.js

View workflow job for this annotation

GitHub Actions / Error on purpose

scope does not match
// ^^^^^ - variable.parameter.function.js
) => 8 + 9
Loading