From 0f5811b39504a0f63b29890a2c538c22396e508f Mon Sep 17 00:00:00 2001 From: clavedeluna Date: Tue, 17 Oct 2023 16:29:20 -0300 Subject: [PATCH] add flags to semgrep --- src/codemodder/semgrep.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/codemodder/semgrep.py b/src/codemodder/semgrep.py index 59493d04d..1a2cad9a7 100644 --- a/src/codemodder/semgrep.py +++ b/src/codemodder/semgrep.py @@ -26,6 +26,20 @@ def run(execution_context: CodemodExecutionContext, yaml_files: List[Path]) -> d "-o", temp_sarif_file.name, ] + + if execution_context.path_exclude: + command.extend( + itertools.chain.from_iterable( + map(lambda f: ["--exclude", str(f)], execution_context.path_exclude) + ) + ) + if execution_context.path_include: + command.extend( + itertools.chain.from_iterable( + map(lambda f: ["--include", str(f)], execution_context.path_include) + ) + ) + command.extend( itertools.chain.from_iterable( map(lambda f: ["--config", str(f)], yaml_files)