DataDog / datadog-static-analyzer

Datadog Static Analyzer
https://docs.datadoghq.com/static_analysis/
Apache License 2.0
100 stars 12 forks source link

[STAL-2338] feat: add Bash support #414

Closed amaanq closed 3 months ago

amaanq commented 3 months ago

What problem are you trying to solve?

Currently, we do not support Bash files. We need a way to parse and query bash files, but we do not currently fetch and build a Bash grammar.

What is your solution?

Add the Bash grammar to the analyzer itself, which is fetched from https://github.com/tree-sitter/tree-sitter-bash. This will allow us (and customers down the line) to begin writing rules targeting Bash files.

Alternatives considered

Not supporting bash files

What the reviewer should know

I renamed the python example code string to be prefixed with PYTHON_ since I added a bash one too, and reused this in the Starlark test hence why the code relating to the Starlark test was modified.