Skip to content

Commit

Permalink
Do not auto pull in local rules if logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
brendongo committed Mar 30, 2022
1 parent fad902b commit 986609e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/semgrep_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def adapt_environment() -> set[str]:
# registry URL needs to be updated as well; this URL expects trailing slash
os.environ["SEMGREP_URL"] = os.environ["SEMGREP_APP_URL"].rstrip("/") + "/"

if Path(".semgrep.yml").exists():
os.environ["SEMGREP_RULES"] = ".semgrep.yml"
if Path(".semgrep").exists():
os.environ["SEMGREP_RULES"] = ".semgrep"
if not os.getenv("SEMGREP_APP_TOKEN"):
if Path(".semgrep.yml").exists():
os.environ["SEMGREP_RULES"] = ".semgrep.yml"
if Path(".semgrep").exists():
os.environ["SEMGREP_RULES"] = ".semgrep"

return new_flags

Expand Down

0 comments on commit 986609e

Please sign in to comment.