forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): cli deduplication in core (semgrep#9711)
## What: This PR moves the CLI deduplication (based on `cli_unique_key`) to the Core engine. ## Why: This makes the core output more in line with the cli output, and prevents duplication of the logic across pysemgrep and osemgrep. ## How: The cli unique key is based on the rule metadata, so I had to move that to the pattern matches. I also deleted the deduplication logic from the `pysemgrep` side. ## Test plan: Tests still pass. Note that I updated a bunch of snapshots. This is because of [this line](https://github.com/semgrep/semgrep/blob/39f95450a7d4d70e54c9edbd109bed8210a36889/cli/src/semgrep/core_runner.py#L771) in the pysemgrep core runner, which reorders the fields of the rule JSON before it enters the core engine. When the core engine didn't used to deal with metadata, this means that `pysemgrep` would insert the metadata, in a non-sorted manner. Now, though, the core engine reports the sorted metadata, which is correct, as that's the metadata it receives. This changes the order in the snapshot data, though, so we need to change it to reflect the data the core engine is returning.
- Loading branch information
1 parent
d073c16
commit 752b48d
Showing
76 changed files
with
1,051 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.