codeql icon indicating copy to clipboard operation
codeql copied to clipboard

`A parse error occurred. Check the syntax of the file.` for correct ruby file

Open VitaliySerov opened this issue 1 year ago • 3 comments
trafficstars

Hi all, I have a CodeQL connected to this repo: https://github.com/ONLYOFFICE-QA/testing-site-onlyoffice

And in codeql logs I see the line:

2024-06-14T08:55:36.1255023Z [2024-06-14 08:55:36] [build-stdout] [2024-06-14 08:55:36] [build-stdout] [33m WARN[0m /home/runner/work/testing-site-onlyoffice/testing-site-onlyoffice/shared_examples/desktop_installer_download.rb:29: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.

The thing is this is correct ruby code - I don't have any problems running this code

So probably something is wrong with codeql file parser

Env

CodeQL 2.17.5

VitaliySerov avatar Jun 14 '24 09:06 VitaliySerov

Hi @VitaliySerov 👋

Thanks for reporting this. I have passed this on to our Ruby team to look at.

mbg avatar Jun 19 '24 10:06 mbg

Tree-sitter grammar fix: https://github.com/tree-sitter/tree-sitter-ruby/pull/262.

hvitved avatar Jun 19 '24 18:06 hvitved

Fix: https://github.com/github/codeql/pull/16801

hvitved avatar Jun 21 '24 09:06 hvitved