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

CMake language support #10000

Open
ligurio opened this issue Mar 25, 2024 · 2 comments
Open

CMake language support #10000

ligurio opened this issue Mar 25, 2024 · 2 comments

Comments

@ligurio
Copy link

ligurio commented Mar 25, 2024

Is your feature request related to a problem? Please describe.

I want to use semgrep to find any problems in CMake files. There is no good and supported static analyzer for CMake,
(see section "Describe alternatives you've considered" below), so I want to create semgrep rules for CMake on my own and use them in CMake projects.

CMake is the most popular build systems in C/C++ projects (sources: 12):

C:

image

C++:

image

Describe the solution you'd like

Running Semgrep with rules for CMake declarative language and detect errors and mistakes by Semgrep custom rules.

Describe alternatives you've considered

Use case

It will be easier to add rules for static analysis of CMake files.

Additional context

Footnotes

  1. https://www.jetbrains.com/lp/devecosystem-2023/c/

  2. https://www.jetbrains.com/lp/devecosystem-2023/cpp/

@aryx
Copy link
Collaborator

aryx commented Mar 26, 2024

I see https://github.com/uyha/tree-sitter-cmake
and https://github.com/Symbitic/tree-sitter-cmake
which could be good candidates to use to add support for cmake in semgrep.

@aryx
Copy link
Collaborator

aryx commented Mar 26, 2024

Oh actually the second one above is to a project to build tree-sitter using cmake, so not relevant for this issue.
But I guess we still have the first one https://github.com/uyha/tree-sitter-cmake as a good starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants