Skip to content

Commit

Permalink
Merge pull request semgrep#551 from returntocorp/brendon/dontusedefau…
Browse files Browse the repository at this point in the history
…ltwhenloggeding

Do not auto pull in local rules if logged in
  • Loading branch information
brendongo authored Mar 30, 2022
2 parents fad902b + 986609e commit 6808f99
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 6808f99

Please sign in to comment.