From f52cb5598421bff6a9fa04489faac0da622417e9 Mon Sep 17 00:00:00 2001 From: elsapet Date: Mon, 13 May 2024 15:51:56 +0200 Subject: [PATCH] fix: arg parser patterns --- rules/python/shared/lang/dynamic_input.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/rules/python/shared/lang/dynamic_input.yml b/rules/python/shared/lang/dynamic_input.yml index 7e70b77b..cef0d9bf 100644 --- a/rules/python/shared/lang/dynamic_input.yml +++ b/rules/python/shared/lang/dynamic_input.yml @@ -11,10 +11,23 @@ patterns: auxiliary: - id: python_shared_lang_dynamic_input_parser patterns: - - pattern: $ + - pattern: $() filters: - variable: ARG_PARSER - regex: \A(argparse\.)ArgumentParser?\z + detection: python_shared_lang_dynamic_input_argparser_init + - id: python_shared_lang_dynamic_input_argparser_init + patterns: + - ArgumentParser + - from argparse import ArgumentParser as $$<_> + - pattern: $.ArgumentParser + filters: + - variable: ARGPARSE + detection: python_shared_lang_dynamic_input_argparse_import + - id: python_shared_lang_dynamic_input_argparse_import + patterns: + - argparse + - import $argparse + - import argparse as $$<_> metadata: description: "Python dynamic input." id: python_shared_lang_dynamic_input