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

Adjust error message parsing for the new syntax test output format #24

Open
FichteFoll opened this issue Feb 6, 2025 · 0 comments · May be fixed by #25
Open

Adjust error message parsing for the new syntax test output format #24

FichteFoll opened this issue Feb 6, 2025 · 0 comments · May be fixed by #25

Comments

@FichteFoll
Copy link
Member

FichteFoll commented Feb 6, 2025

The syntax test output format has changed via sublimehq/sublime_text#3022.

Here is some example output (via):

Data path: /home/runner/work/syntax-test-action/syntax_tests/Data
Cache path: /home/runner/work/syntax-test-action/syntax_tests/Data/Cache
Packages path: /home/runner/work/syntax-test-action/syntax_tests/Data/Packages
Running: /home/runner/work/syntax-test-action/syntax_tests/Data/Packages/syntax-test-action/syntax_test_js.js
/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

(leading whitespace is stripped, presumably by the log display)

Previously, the error message was on the same line as the rest of the metadata (file name, col, row) and I'm not sure currently if the ::error reporting can handle multiple lines.

Code that needs updating:

if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then
IFS=$':' read -r path row col message <<< "$line"
file="${path/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}"
# 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# }"
fi

The updated logic also needs to be conditional since the format has began with build 4181.

Documentation: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions

michaelblyons pushed a commit to michaelblyons/SublimeText-SyntaxTestAction that referenced this issue Feb 11, 2025
@michaelblyons michaelblyons linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant