forked from ethereum-optimism/optimism
-
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.
feat(ci): add local semgrep scanning (ethereum-optimism#12281)
Adds local semgrep scanning with blocking CI rules. Since this is local it will run without needing to log in to semgrep and can therefore run on external branches.
- Loading branch information
1 parent
a9f8330
commit 9c91fff
Showing
2 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
rules: | ||
- id: sol-safety-deployutils-args | ||
pattern-regex: DeployUtils\.(create1|create2|create1AndSave|create2AndSave)\s*\(\s*\{[^}]*?_args\s*:\s*(?!\s*DeployUtils\.encodeConstructor\()\s*[^}]*?\}\s*\) | ||
message: _args parameter should be wrapped with DeployUtils.encodeConstructor | ||
severity: ERROR | ||
languages: | ||
- solidity | ||
- id: sol-style-input-arg-fmt | ||
pattern-regex: function\s+\w+\s*\(\s*([^)]*?\b\w+\s+(?!_)(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+\s*(?=,|\))) | ||
message: Named inputs to functions must be prepended with an underscore | ||
severity: ERROR | ||
languages: | ||
- solidity | ||
- id: sol-style-return-arg-fmt | ||
pattern-regex: returns\s*(\w+\s*)?\(\s*([^)]*?\b\w+\s+(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+(?<!_)\s*(?=,|\))) | ||
message: Named return arguments to functions must be appended with an underscore | ||
severity: ERROR | ||
languages: | ||
- solidity |