semgrep / semgrep

Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.

Home Page:https://semgrep.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to configure `--project-root`

dustyhorizon opened this issue · comments

Describe the bug
Configuring --project-root returns Error: No such option: --project-root

This should not be the case as --project-root is listed when I do semgrep ci --help

To Reproduce

❯ docker run -it --rm semgrep/semgrep:1.65.0 semgrep ci --project-root /tmp
Usage: semgrep ci [OPTIONS]

Error: No such option: --project-root

Running this with an invalid path causes Semgrep to "acknowledge" that --project-root exists

❯ docker run -it --rm semgrep/semgrep:1.65.0 semgrep ci --project-root /asd
[00.06][ERROR]: Error: Cannot determine physical path for "/asd": No such file or directory
Error: fatal error
Exiting with error status 2: osemgrep ci --project-root /asd

Expected behavior
Semgrep to run with --project-root respected

What is the priority of the bug to you?

  • P0: blocking your adoption of Semgrep or workflow
  • P1: important to fix or quite annoying
  • P2: regular bug that should get fixed

Environment
Running the semgrep/semgrep:1.65.0 docker image but CLI build via brew install semgrep is not working as well

Use case
I am curating a set of examples in which Semgrep can be used for, --project-root allows me to scope the scan (and .semgrepignore, etc.) within that example folder.

Seems like this was erroneously documented and also requires the --experimental flag.

Will be switching back to --exclude/--include syntax.