github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.32k stars 1.47k forks source link

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

Open VitaliySerov opened 3 weeks ago

VitaliySerov commented 3 weeks ago

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]  WARN /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

mbg commented 2 weeks ago

Hi @VitaliySerov 👋

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

hvitved commented 2 weeks ago

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

hvitved commented 2 weeks ago

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