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

osemgrep: no files scanned when they should be #10253

Open
2 tasks
fopinappb opened this issue May 15, 2024 · 0 comments
Open
2 tasks

osemgrep: no files scanned when they should be #10253

fopinappb opened this issue May 15, 2024 · 0 comments
Labels
bug Something isn't working osemgrep Fixes/features expected to be shipped with osemgrep

Comments

@fopinappb
Copy link

fopinappb commented May 15, 2024

Describe the bug

#9813 (comment) is the original bug report but as a comment (discovery) of a different.

Using osemgrep to scan a single file under a git repository fails to find any findings. --no-git-ignore does not help (as the file was not ignored), removing .git does.

Scanning the directory that owns the file however does produce findings.

To Reproduce

The rule and test code used:

➜  semgrep --version
1.72.0

➜  git ls-files
...
samples/dangerous-code-run.py
samples/dangerous-code-run.yaml
...

➜  semgrep -f samples/dangerous-code-run.yaml samples/dangerous-code-run.py
...
Ran 1 rule on 1 file: 1 finding.

➜  semgrep --experimental -f samples/dangerous-code-run.yaml samples/dangerous-code-run.py
...
  Scanning 1 file tracked by git with 1 Code rule:
  Scanning 1 file.
...
Ran 1 rule on 0 files: 0 findings.

➜  semgrep --experimental -f samples/dangerous-code-run.yaml samples/
...
Ran 1 rule on 1 file: 1 finding.

Expected behavior

osemgrep to report the same finding as pysemgrep does.

What is the priority of the bug to you?

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

Environment
official binary, version 1.72, macOS

Use case
It will enable properly scanning git repositories using osemgrep without removing the repository...

@ievans ievans added bug Something isn't working osemgrep Fixes/features expected to be shipped with osemgrep labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working osemgrep Fixes/features expected to be shipped with osemgrep
Development

No branches or pull requests

2 participants