Skip to content

Commit

Permalink
remove semgrep shouldafound (semgrep#8493)
Browse files Browse the repository at this point in the history
The command was not really used (1 issue reported per month
in https://github.com/returntocorp/issue-test/issues and
in Slack under #shouldafound-alerts).
It's just simpler to remove rather than spending the time to port
it to osemgrep.

This mostly revert semgrep#5291


https://linear.app/semgrep/issue/PA-3003/create-a-shouldafound-alternative-in-the-vscode-extension
is tracking moving such a feature to our vscode extension instead.

BTW the backend code is in
https://github.com/returntocorp/shouldafound
and the only occurence in semgrep-app is in an error message (that
I'll update in a separate PR).

test plan:
make test


PR checklist:

- [ ] Purpose of the code is [evident to future
readers](https://semgrep.dev/docs/contributing/contributing-code/#explaining-code)
- [ ] Tests included or PR comment includes a reproducible test plan
- [ ] Documentation is up-to-date
- [ ] A changelog entry was [added to
changelog.d](https://semgrep.dev/docs/contributing/contributing-code/#adding-a-changelog-entry)
for any user-facing change
- [ ] Change has no security implications (otherwise, ping security
team)

If you're unsure about any of this, please see:

- [Contribution
guidelines](https://semgrep.dev/docs/contributing/contributing-code)!
- [One of the more specific guides located
here](https://semgrep.dev/docs/contributing/contributing/)
  • Loading branch information
Yoann Padioleau authored Aug 18, 2023
1 parent f991a6f commit e902d23
Show file tree
Hide file tree
Showing 24 changed files with 3 additions and 762 deletions.
3 changes: 3 additions & 0 deletions changelog.d/shouldafound.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The 'semgrep shouldafound' command has been removed. It was not really used
and it might be better to offer such a functionality in the IDE instead of
in the CLI.
2 changes: 0 additions & 2 deletions cli/src/semgrep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from semgrep.commands.lsp import lsp
from semgrep.commands.publish import publish
from semgrep.commands.scan import scan
from semgrep.commands.shouldafound import shouldafound
from semgrep.default_group import DefaultGroup
from semgrep.state import get_state
from semgrep.util import git_check_output
Expand Down Expand Up @@ -78,5 +77,4 @@ def cli(ctx: click.Context) -> None:
cli.add_command(publish)
cli.add_command(scan)
cli.add_command(install_semgrep_pro)
cli.add_command(shouldafound)
cli.add_command(lsp)
145 changes: 0 additions & 145 deletions cli/src/semgrep/commands/shouldafound.py

This file was deleted.

11 changes: 0 additions & 11 deletions cli/src/semgrep/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ class Env:
default=EnvFactory(["SEMGREP_URL", "SEMGREP_APP_URL"], "https://semgrep.dev"),
converter=url,
)
shouldafound_base_url: str = field(
default=EnvFactory(
"SEMGREP_SHOULDAFOUND_BASE_URL", "https://shouldafound.semgrep.dev"
),
converter=url,
)
app_token: Optional[str] = field(default=EnvFactory("SEMGREP_APP_TOKEN"))

version_check_url: str = field(
Expand All @@ -92,7 +86,6 @@ class Env:
in_docker: bool = field()
in_gh_action: bool = field()
in_agent: bool = field()
shouldafound_no_email: bool = field()
min_fetch_depth: int = field()

upload_findings_timeout: int = field()
Expand Down Expand Up @@ -156,10 +149,6 @@ def in_gh_action_default(self) -> bool:
def in_agent_default(self) -> bool:
return "SEMGREP_AGENT" in os.environ

@shouldafound_no_email.default
def shouldafound_no_email_default(self) -> bool:
return "SEMGREP_SHOULDAFOUND_NO_EMAIL" in os.environ

@min_fetch_depth.default
def min_fetch_depth_default(self) -> int:
value = os.getenv("SEMGREP_GHA_MIN_FETCH_DEPTH", "0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ Commands:
lsp [EXPERIMENTAL] Start the Semgrep LSP server
publish Upload rule to semgrep.dev
scan Run semgrep rules on files
shouldafound Report a false negative in this project.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ Commands:
lsp [EXPERIMENTAL] Start the Semgrep LSP server
publish Upload rule to semgrep.dev
scan Run semgrep rules on files
shouldafound Report a false negative in this project.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e902d23

Please sign in to comment.