From 7262436ff0a72c80524ab9965e95ace9db224689 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 15:44:38 -0500 Subject: [PATCH 01/36] Adjust error message parsing for new syntax tests Extremely naively. See #24 --- syntax-tests.sh | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index c543b9f..47ff15f 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -158,14 +158,36 @@ 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 - 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] - 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 - done + +if [[ $build < 4081 ]]; then + "$folder/syntax_tests" \ + | while 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] + 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 + done +else + "$folder/syntax_tests" \ + | while read -r line; do + echo "${line/^ /.}" # Replace first char so it doesn't get + # /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" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then + IFS=$':' read -r path row col <<< "$line" + file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" + read -r message + # 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 + done +fi From e2d366a9d7f9a2191bbbb2131d885e10894bebc9 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 15:48:08 -0500 Subject: [PATCH 02/36] Temporarily enable action on push --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a03fd24..62c9a7d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Tests on: push: + paths: '*' pull_request: schedule: - cron: "* 0 * * SAT" From 03f59ccbfa973130c3144da2d8335d89353f4a3f Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 15:49:11 -0500 Subject: [PATCH 03/36] Temporarily disable action on cron --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62c9a7d..e1c9cec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,8 +4,8 @@ on: push: paths: '*' pull_request: - schedule: - - cron: "* 0 * * SAT" + # schedule: + # - cron: "* 0 * * SAT" workflow_dispatch: jobs: From 9e84e795a1b8178e1f50f87f1fb7d4a8821b4c92 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:02:01 -0500 Subject: [PATCH 04/36] Temporarily make the build unattainable --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 47ff15f..d538f77 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -159,7 +159,7 @@ create_dummy_syntaxes # https://github.com/rbialon/flake8-annotations/blob/master/index.js echo 'Running binary' -if [[ $build < 4081 ]]; then +if [[ $build < 1000 ]]; then "$folder/syntax_tests" \ | while read -r line; do echo "$line" From b4933e57b3eafe38afdf7b0be776c6ebac7e836a Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:04:30 -0500 Subject: [PATCH 05/36] Add some debug messages --- syntax-tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index d538f77..0787731 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -158,8 +158,10 @@ 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' +echo "Runner version $build" if [[ $build < 1000 ]]; then + echo "Running old" "$folder/syntax_tests" \ | while read -r line; do echo "$line" @@ -172,9 +174,10 @@ if [[ $build < 1000 ]]; then fi done else + echo "Running new" "$folder/syntax_tests" \ | while read -r line; do - echo "${line/^ /.}" # Replace first char so it doesn't get + echo "${line/^ /.}" # Replace first char so it doesn't get elided # /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 From 2f9f9bdc889ea08ae0d8b6a23ea18161bc8b8ef1 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:05:04 -0500 Subject: [PATCH 06/36] Temporarily disable most of the tests --- .github/workflows/test.yml | 154 ++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1c9cec..206e6da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,90 +9,90 @@ on: workflow_dispatch: jobs: - no_defpkg_stable: - name: Without default packages, latest stable - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - build: stable - package_root: test/no_defpkg + # no_defpkg_stable: + # name: Without default packages, latest stable + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: stable + # package_root: test/no_defpkg - # TODO indentation tests - # TODO reference & definition tests + # # TODO indentation tests + # # TODO reference & definition tests - defpkg_stable: - name: With default packages, latest stable - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - build: stable - default_packages: binary - package_root: test/defpkg + # defpkg_stable: + # name: With default packages, latest stable + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: stable + # default_packages: binary + # package_root: test/defpkg - no_defpkg_old_build: - name: Without default packages, build 4073 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - build: 4073 - package_root: test/no_defpkg + # no_defpkg_old_build: + # name: Without default packages, build 4073 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: 4073 + # package_root: test/no_defpkg - third-party_stable: - name: Third-party, latest stable - runs-on: ubuntu-latest - steps: - - name: Checkout repo (primary package) - uses: actions/checkout@v4 - - name: Checkout INI package (dependency) - uses: actions/checkout@v4 - with: - repository: jwortmann/ini-syntax - ref: v1.5.0 - path: third-party/INI - - uses: ./ - with: - build: stable - package_root: test/third-party - additional_packages: third-party/INI + # third-party_stable: + # name: Third-party, latest stable + # runs-on: ubuntu-latest + # steps: + # - name: Checkout repo (primary package) + # uses: actions/checkout@v4 + # - name: Checkout INI package (dependency) + # uses: actions/checkout@v4 + # with: + # repository: jwortmann/ini-syntax + # ref: v1.5.0 + # path: third-party/INI + # - uses: ./ + # with: + # build: stable + # package_root: test/third-party + # additional_packages: third-party/INI - dummy_syntax_stable: - name: Dummy Syntax, latest stable - runs-on: ubuntu-latest - steps: - - name: Checkout repo (primary package) - uses: actions/checkout@v4 - - uses: ./ - with: - build: stable - package_root: test/dummy-syntax - dummy_syntaxes: text.dummy + # dummy_syntax_stable: + # name: Dummy Syntax, latest stable + # runs-on: ubuntu-latest + # steps: + # - name: Checkout repo (primary package) + # uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: stable + # package_root: test/dummy-syntax + # dummy_syntaxes: text.dummy - st3: - name: Without default packages, ST3 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - build: 3210 - default_packages: v3189 - package_root: test/st3 + # st3: + # name: Without default packages, ST3 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: 3210 + # default_packages: v3189 + # package_root: test/st3 - st3_no_defpkg_old_runtime: - name: Without default packages, ST3, ubuntu-20.04 - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - build: 3210 - package_root: test/no_defpkg + # st3_no_defpkg_old_runtime: + # name: Without default packages, ST3, ubuntu-20.04 + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v4 + # - uses: ./ + # with: + # build: 3210 + # package_root: test/no_defpkg # This is expected to error and used to test the error wrapper st3_error: From 869405c18860362094847fd028d4a9ff1633a2ec Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:10:14 -0500 Subject: [PATCH 07/36] Fix echo for new test output --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 0787731..3057dba 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -177,7 +177,6 @@ else echo "Running new" "$folder/syntax_tests" \ | while read -r line; do - echo "${line/^ /.}" # Replace first char so it doesn't get elided # /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 @@ -185,6 +184,7 @@ else # | ^^^^^ these locations did not match # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js + echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" From 524ec7542fd88d7687fe92d4d09cfa04ab493d83 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:12:17 -0500 Subject: [PATCH 08/36] Add some debug trash --- syntax-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax-tests.sh b/syntax-tests.sh index 3057dba..4d75b73 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -185,6 +185,7 @@ else # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided + echo "It's a line" if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" From 3ba2433b53122e38013516d8ddd976c82c6bfebe Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:16:38 -0500 Subject: [PATCH 09/36] Use no-IFS line for echo --- syntax-tests.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 4d75b73..b2a6eff 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -184,8 +184,9 @@ else # | ^^^^^ these locations did not match # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js - echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided - echo "It's a line" + # echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided + # echo "It's a line" + echo "$REPLY" if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" From c18e2db27d14de589d65ca698b5d9fe341c0c3a2 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:20:08 -0500 Subject: [PATCH 10/36] Explicitly drop IFS --- syntax-tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index b2a6eff..a76d1a9 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -175,6 +175,7 @@ if [[ $build < 1000 ]]; then done else echo "Running new" + IFS='' "$folder/syntax_tests" \ | while read -r line; do # /home/runner/work/syntax-test-action/syntax_tests/Data/Packages/syntax-test-action/syntax_test_js.js:8:8 @@ -186,7 +187,8 @@ else # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js # echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided # echo "It's a line" - echo "$REPLY" + # echo "$REPLY" + echo "$line" if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" @@ -194,5 +196,6 @@ else # 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 + IFS='' done fi From 4aadc85cf3e0e819e694df154f470290ded5ac16 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:21:25 -0500 Subject: [PATCH 11/36] Cleanup line formatting --- syntax-tests.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index a76d1a9..a0aa045 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -185,9 +185,6 @@ else # | ^^^^^ these locations did not match # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js - # echo "$line" | sed 's/^ /./' # Replace first char so it doesn't get elided - # echo "It's a line" - # echo "$REPLY" echo "$line" if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" From b049d4b5e9b5de7b40a090b586faa7271de5d3c0 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:22:27 -0500 Subject: [PATCH 12/36] Add more debug --- syntax-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax-tests.sh b/syntax-tests.sh index a0aa045..e4cb57a 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -186,6 +186,7 @@ else # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js echo "$line" + echo "$folder/$packages/$INPUT_PACKAGE_NAME" if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" From 1fb127a91a93620ddec6d70d83ce9440a51f6d67 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:23:49 -0500 Subject: [PATCH 13/36] Fix new line test --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index e4cb57a..acd9b8c 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -187,7 +187,7 @@ else # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js echo "$line" echo "$folder/$packages/$INPUT_PACKAGE_NAME" - if [[ "$line" == "$folder/$packages/$INPUT_PACKAGE_NAME/"* ]]; then + if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" read -r message From c49b3caaef314206f4eadcddbdac1fdf49d26782 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:28:00 -0500 Subject: [PATCH 14/36] Trim error text --- syntax-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index acd9b8c..4593478 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -186,13 +186,12 @@ else # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js echo "$line" - echo "$folder/$packages/$INPUT_PACKAGE_NAME" if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" read -r message # 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 "::error file=$file,line=$row,col=$col::${message#error: }" fi IFS='' done From 8f3a725f4d67607b81b564f55713a26a1c2f53a5 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:30:03 -0500 Subject: [PATCH 15/36] Revert "Temporarily make the build unattainable" This reverts commit 9e84e795a1b8178e1f50f87f1fb7d4a8821b4c92. --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 4593478..9f4e00f 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -160,7 +160,7 @@ create_dummy_syntaxes echo 'Running binary' echo "Runner version $build" -if [[ $build < 1000 ]]; then +if [[ $build < 4081 ]]; then echo "Running old" "$folder/syntax_tests" \ | while read -r line; do From ec7841a85f85248489b67939671a499bbadaa2b9 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:49:46 -0500 Subject: [PATCH 16/36] Consolidate if statements --- syntax-tests.sh | 61 ++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 9f4e00f..21bce52 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -158,41 +158,34 @@ 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' -echo "Runner version $build" -if [[ $build < 4081 ]]; then - echo "Running old" - "$folder/syntax_tests" \ - | while read -r line; do - echo "$line" +IFS='' +"$folder/syntax_tests" \ + | while read -r line; do + echo "$line" + + if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then + + ### Before 4081 # /syntax_tests/Data/Packages/syntax-test-action/test/defpkg/syntax_test_test:7:1: [source.python constant.language] does not match scope [text.test] - 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 - done -else - echo "Running new" - IFS='' - "$folder/syntax_tests" \ - | while read -r line; do - # /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 - echo "$line" - if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then - IFS=$':' read -r path row col <<< "$line" - file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - read -r message - # 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#error: }" + IFS=$':' read -r path row col message <<< "$line" + + if [[ $build >= 4081 ]]; then + + ### Since 4081 + # /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 + read -r _ message fi + 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# }" IFS='' - done -fi + fi + done +IFS=' \t\n' From 7b74f3dce00807f0841654c5bcd92397d83e09fb Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:52:54 -0500 Subject: [PATCH 17/36] Revert "Consolidate if statements" This reverts commit ec7841a85f85248489b67939671a499bbadaa2b9. --- syntax-tests.sh | 61 +++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 21bce52..9f4e00f 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -158,34 +158,41 @@ 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' +echo "Runner version $build" -IFS='' -"$folder/syntax_tests" \ - | while read -r line; do - echo "$line" - - if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then - - ### Before 4081 +if [[ $build < 4081 ]]; then + echo "Running old" + "$folder/syntax_tests" \ + | while 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] - IFS=$':' read -r path row col message <<< "$line" - - if [[ $build >= 4081 ]]; then - - ### Since 4081 - # /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 - read -r _ message + 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 + done +else + echo "Running new" + IFS='' + "$folder/syntax_tests" \ + | while read -r line; do + # /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 + echo "$line" + if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then + IFS=$':' read -r path row col <<< "$line" + file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" + read -r message + # 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#error: }" fi - 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# }" IFS='' - fi - done -IFS=' \t\n' + done +fi From e9c1df5b11aa921ccd8729eb7cbc6a876a9244c0 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:54:06 -0500 Subject: [PATCH 18/36] Move the IFS assignment carefully --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 9f4e00f..0fc4217 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -160,6 +160,7 @@ create_dummy_syntaxes echo 'Running binary' echo "Runner version $build" +IFS='' if [[ $build < 4081 ]]; then echo "Running old" "$folder/syntax_tests" \ @@ -175,7 +176,6 @@ if [[ $build < 4081 ]]; then done else echo "Running new" - IFS='' "$folder/syntax_tests" \ | while read -r line; do # /home/runner/work/syntax-test-action/syntax_tests/Data/Packages/syntax-test-action/syntax_test_js.js:8:8 From 300e6b0c55bb0ec71550d74b2d9753c5227d6e08 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 16:56:40 -0500 Subject: [PATCH 19/36] Move new format first --- syntax-tests.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 0fc4217..0a78cab 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -161,6 +161,27 @@ echo 'Running binary' echo "Runner version $build" IFS='' +echo "Running new" +"$folder/syntax_tests" \ + | while read -r line; do + # /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 + echo "$line" + if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then + IFS=$':' read -r path row col <<< "$line" + file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" + read -r message + # 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#error: }" + fi + IFS='' + done + if [[ $build < 4081 ]]; then echo "Running old" "$folder/syntax_tests" \ @@ -174,25 +195,4 @@ if [[ $build < 4081 ]]; then echo "::error file=$file,line=$row,col=$col::${message# }" fi done -else - echo "Running new" - "$folder/syntax_tests" \ - | while read -r line; do - # /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 - echo "$line" - if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then - IFS=$':' read -r path row col <<< "$line" - file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - read -r message - # 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#error: }" - fi - IFS='' - done fi From c89365077abd534162e2b5bf118bda1feb9df5a3 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:01:26 -0500 Subject: [PATCH 20/36] Read log type --- syntax-tests.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 0a78cab..a9afe03 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -158,12 +158,15 @@ 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' -echo "Runner version $build" IFS='' -echo "Running new" "$folder/syntax_tests" \ | while read -r line; do + echo "$line" + ### Before 4081 + # /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 4081 # /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 @@ -171,13 +174,12 @@ echo "Running new" # | ^^^^^ these locations did not match # actual: # | ^^^^^ source.js meta.function.parameters.js meta.binding.name.js variable.parameter.function.js - echo "$line" if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - read -r message + read -r logtype message # 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#error: }" + echo "::${logtype:-error} file=$file,line=$row,col=$col::${message#error: }" fi IFS='' done From 8b216614b182f04b87346dce2f756c7081c84009 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:04:36 -0500 Subject: [PATCH 21/36] Fixup read log type --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index a9afe03..1826c3d 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -177,7 +177,7 @@ IFS='' if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - read -r logtype message + IFS=$':' read -r logtype message # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message echo "::${logtype:-error} file=$file,line=$row,col=$col::${message#error: }" fi From e3dc2601f0ff750e2529fc120dfc4a4a3ec92c3f Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:05:39 -0500 Subject: [PATCH 22/36] Fixup log echo --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 1826c3d..17120c1 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -179,7 +179,7 @@ IFS='' file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" IFS=$':' read -r logtype message # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - echo "::${logtype:-error} file=$file,line=$row,col=$col::${message#error: }" + echo "::${logtype:-error} file=$file,line=$row,col=$col::${message# }" fi IFS='' done From d68e37aa52bb2cbe83ad6b796f30bc84b983e21f Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:06:26 -0500 Subject: [PATCH 23/36] Test reading message twice with mismatched arg length --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 17120c1..9c22ad5 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -175,7 +175,7 @@ IFS='' # 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 <<< "$line" + IFS=$':' read -r path row col message <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" IFS=$':' read -r logtype message # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message From ca849e1b90105dfc101bab5baa4e9102443b6fce Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:08:02 -0500 Subject: [PATCH 24/36] Merge both old and new formats --- syntax-tests.sh | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 9c22ad5..7bbed02 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -177,24 +177,11 @@ IFS='' if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col message <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - IFS=$':' read -r logtype message + if [[ $build >= 4081 ]]; then + IFS=$':' read -r logtype message + fi # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message echo "::${logtype:-error} file=$file,line=$row,col=$col::${message# }" fi IFS='' done - -if [[ $build < 4081 ]]; then - echo "Running old" - "$folder/syntax_tests" \ - | while 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] - 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 - done -fi From 3a72bb11d033c6f26985adf32507fc72a7aa9656 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:10:22 -0500 Subject: [PATCH 25/36] Use math expansion for version test --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 7bbed02..462314b 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -177,7 +177,7 @@ IFS='' if [[ "$line" == "$packages/$INPUT_PACKAGE_NAME/"* ]]; then IFS=$':' read -r path row col message <<< "$line" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - if [[ $build >= 4081 ]]; then + if (( $build >= 4081 )); then IFS=$':' read -r logtype message fi # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message From 7d66cdfed7b6551f7f36cbeddaf0f2900ae72305 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:13:10 -0500 Subject: [PATCH 26/36] Add debug statements --- syntax-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syntax-tests.sh b/syntax-tests.sh index 462314b..bec2c5b 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -176,6 +176,11 @@ IFS='' # | ^^^^^ 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" + echo "path: $path" + echo "folder: $folder" + echo "packages: $packages" + echo "input name: $INPUT_PACKAGE_NAME" + echo "input root: $INPUT_PACKAGE_ROOT" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" if (( $build >= 4081 )); then IFS=$':' read -r logtype message From 5f22e57d99885aa520fadc584019c68ab66693aa Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:14:50 -0500 Subject: [PATCH 27/36] Add another debug statement --- syntax-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax-tests.sh b/syntax-tests.sh index bec2c5b..4e5030d 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -182,6 +182,7 @@ IFS='' echo "input name: $INPUT_PACKAGE_NAME" echo "input root: $INPUT_PACKAGE_ROOT" file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" + echo "file: $file" if (( $build >= 4081 )); then IFS=$':' read -r logtype message fi From e468f88177bc533526551976df4f73c728ccfb1f Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:22:43 -0500 Subject: [PATCH 28/36] Fix file path rewrite --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 4e5030d..18abdd3 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -181,7 +181,7 @@ IFS='' echo "packages: $packages" echo "input name: $INPUT_PACKAGE_NAME" echo "input root: $INPUT_PACKAGE_ROOT" - file="${path/$folder\/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" + file="${path/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" echo "file: $file" if (( $build >= 4081 )); then IFS=$':' read -r logtype message From de2a370fc3957e4bebb984121935577ef9230875 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:27:52 -0500 Subject: [PATCH 29/36] Revert "Temporarily disable most of the tests" This reverts commit 2f9f9bdc889ea08ae0d8b6a23ea18161bc8b8ef1. --- .github/workflows/test.yml | 154 ++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 206e6da..e1c9cec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,90 +9,90 @@ on: workflow_dispatch: jobs: - # no_defpkg_stable: - # name: Without default packages, latest stable - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: stable - # package_root: test/no_defpkg + no_defpkg_stable: + name: Without default packages, latest stable + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + build: stable + package_root: test/no_defpkg - # # TODO indentation tests - # # TODO reference & definition tests + # TODO indentation tests + # TODO reference & definition tests - # defpkg_stable: - # name: With default packages, latest stable - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: stable - # default_packages: binary - # package_root: test/defpkg + defpkg_stable: + name: With default packages, latest stable + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + build: stable + default_packages: binary + package_root: test/defpkg - # no_defpkg_old_build: - # name: Without default packages, build 4073 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: 4073 - # package_root: test/no_defpkg + no_defpkg_old_build: + name: Without default packages, build 4073 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + build: 4073 + package_root: test/no_defpkg - # third-party_stable: - # name: Third-party, latest stable - # runs-on: ubuntu-latest - # steps: - # - name: Checkout repo (primary package) - # uses: actions/checkout@v4 - # - name: Checkout INI package (dependency) - # uses: actions/checkout@v4 - # with: - # repository: jwortmann/ini-syntax - # ref: v1.5.0 - # path: third-party/INI - # - uses: ./ - # with: - # build: stable - # package_root: test/third-party - # additional_packages: third-party/INI + third-party_stable: + name: Third-party, latest stable + runs-on: ubuntu-latest + steps: + - name: Checkout repo (primary package) + uses: actions/checkout@v4 + - name: Checkout INI package (dependency) + uses: actions/checkout@v4 + with: + repository: jwortmann/ini-syntax + ref: v1.5.0 + path: third-party/INI + - uses: ./ + with: + build: stable + package_root: test/third-party + additional_packages: third-party/INI - # dummy_syntax_stable: - # name: Dummy Syntax, latest stable - # runs-on: ubuntu-latest - # steps: - # - name: Checkout repo (primary package) - # uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: stable - # package_root: test/dummy-syntax - # dummy_syntaxes: text.dummy + dummy_syntax_stable: + name: Dummy Syntax, latest stable + runs-on: ubuntu-latest + steps: + - name: Checkout repo (primary package) + uses: actions/checkout@v4 + - uses: ./ + with: + build: stable + package_root: test/dummy-syntax + dummy_syntaxes: text.dummy - # st3: - # name: Without default packages, ST3 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: 3210 - # default_packages: v3189 - # package_root: test/st3 + st3: + name: Without default packages, ST3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + build: 3210 + default_packages: v3189 + package_root: test/st3 - # st3_no_defpkg_old_runtime: - # name: Without default packages, ST3, ubuntu-20.04 - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v4 - # - uses: ./ - # with: - # build: 3210 - # package_root: test/no_defpkg + st3_no_defpkg_old_runtime: + name: Without default packages, ST3, ubuntu-20.04 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + build: 3210 + package_root: test/no_defpkg # This is expected to error and used to test the error wrapper st3_error: From a3da7f28598c3b75487d499b670ad4c5b3e1b554 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:28:08 -0500 Subject: [PATCH 30/36] Remove debug statements --- syntax-tests.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 18abdd3..7295360 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -176,13 +176,7 @@ IFS='' # | ^^^^^ 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" - echo "path: $path" - echo "folder: $folder" - echo "packages: $packages" - echo "input name: $INPUT_PACKAGE_NAME" - echo "input root: $INPUT_PACKAGE_ROOT" file="${path/$packages\/$INPUT_PACKAGE_NAME/$INPUT_PACKAGE_ROOT}" - echo "file: $file" if (( $build >= 4081 )); then IFS=$':' read -r logtype message fi From 429082a187ba8dce1b391d4d45f55c3ebba12c65 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:28:21 -0500 Subject: [PATCH 31/36] Revert "Temporarily disable action on cron" This reverts commit 03f59ccbfa973130c3144da2d8335d89353f4a3f. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1c9cec..62c9a7d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,8 +4,8 @@ on: push: paths: '*' pull_request: - # schedule: - # - cron: "* 0 * * SAT" + schedule: + - cron: "* 0 * * SAT" workflow_dispatch: jobs: From 97adccc4a02a84e5f1c1ab122f0cd27ff8594389 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:28:31 -0500 Subject: [PATCH 32/36] Revert "Temporarily enable action on push" This reverts commit e2d366a9d7f9a2191bbbb2131d885e10894bebc9. --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62c9a7d..a03fd24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Tests on: push: - paths: '*' pull_request: schedule: - cron: "* 0 * * SAT" From 655b88cfccc3a041ffb28e4fd6695c86b47221b5 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Tue, 11 Feb 2025 17:34:03 -0500 Subject: [PATCH 33/36] Don't rewrite IFS as often --- syntax-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 7295360..f16245f 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -182,6 +182,6 @@ IFS='' fi # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message echo "::${logtype:-error} file=$file,line=$row,col=$col::${message# }" + IFS='' fi - IFS='' done From 7773a907e84b9cd29b32776b0d63049df60d806e Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Thu, 13 Feb 2025 10:29:05 -0500 Subject: [PATCH 34/36] Set IFS back to normal, just in case Let's avoid surprising anyone if they append to the script. --- syntax-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax-tests.sh b/syntax-tests.sh index f16245f..22d954d 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -185,3 +185,4 @@ IFS='' IFS='' fi done +IFS=' \t\n' From 6d02fb1b6eb3a1d33c9e9414e86ea121e4f80f67 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Sun, 16 Feb 2025 15:33:46 -0500 Subject: [PATCH 35/36] Experiment with single-command IFS --- syntax-tests.sh | 5 +---- test/st3/syntax_test_js.js | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index 22d954d..d914912 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -159,9 +159,8 @@ create_dummy_syntaxes # https://github.com/rbialon/flake8-annotations/blob/master/index.js echo 'Running binary' -IFS='' "$folder/syntax_tests" \ - | while read -r line; do + | while IFS='' read -r line; do echo "$line" ### Before 4081 # /syntax_tests/Data/Packages/syntax-test-action/test/defpkg/syntax_test_test:7:1: [source.python constant.language] does not match scope [text.test] @@ -182,7 +181,5 @@ IFS='' fi # https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message echo "::${logtype:-error} file=$file,line=$row,col=$col::${message# }" - IFS='' fi done -IFS=' \t\n' diff --git a/test/st3/syntax_test_js.js b/test/st3/syntax_test_js.js index b0213e7..dc0a69e 100644 --- a/test/st3/syntax_test_js.js +++ b/test/st3/syntax_test_js.js @@ -8,3 +8,8 @@ abc = ( param // ^^^^^ - variable.parameter.function.js ) => 1 + 2 + +xyz = ( + param +// ^^^^^ - variable.parameter.function.js + ) => 8 + 9 From ef9a3b4d75b7502968b5d7703ec98254d45285ed Mon Sep 17 00:00:00 2001 From: Michael <2701605+michaelblyons@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:54:23 -0500 Subject: [PATCH 36/36] Fix version number New update was 4181, not 4081 --- syntax-tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syntax-tests.sh b/syntax-tests.sh index d914912..4177b9e 100755 --- a/syntax-tests.sh +++ b/syntax-tests.sh @@ -162,10 +162,10 @@ echo 'Running binary' "$folder/syntax_tests" \ | while IFS='' read -r line; do echo "$line" - ### Before 4081 - # /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 4081 + ### 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 @@ -176,7 +176,7 @@ echo 'Running binary' 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 >= 4081 )); then + 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