-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizing semgrep configurations; correct rule matching glob #21126
Changes from all commits
f092630
c55500a
24b5d51
bb4842c
1e1a899
71e477a
c9e985f
3e47476
8f38d51
582cf7b
e3a961c
ed06049
7579179
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
from pants.engine.rules import Rule, collect_rules | ||
from pants.engine.target import Dependencies, FieldSet, SingleSourceField, Target | ||
from pants.engine.unions import UnionRule | ||
from pants.option.option_types import ArgsListOption, BoolOption, SkipOption | ||
from pants.option.option_types import ArgsListOption, BoolOption, SkipOption, StrOption | ||
from pants.util.strutil import softwrap | ||
|
||
|
||
|
@@ -51,6 +51,18 @@ class SemgrepSubsystem(PythonToolBase): | |
register_lockfile = True | ||
default_lockfile_resource = ("pants.backend.tools.semgrep", "semgrep.lock") | ||
|
||
config_name = StrOption( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, one more thing. I think there's no test that currently exercises this option and its new code-path. Could you expand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. working on it |
||
default=None, | ||
help=softwrap( | ||
""" | ||
The name of the semgrep config file or directory, which will be discovered and used | ||
hierarchically. If using a file, it must have the extension `.yaml` or `.yml`. | ||
|
||
URLs and registry names are not supported. | ||
""" | ||
), | ||
) | ||
|
||
args = ArgsListOption( | ||
example="--verbose", | ||
default=["--quiet"], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this new approach a lot more! Thanks.