Skip to content

Commit

Permalink
fix: arg parser patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet committed May 13, 2024
1 parent b2239e6 commit f52cb55
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions rules/python/shared/lang/dynamic_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,23 @@ patterns:
auxiliary:
- id: python_shared_lang_dynamic_input_parser
patterns:
- pattern: $<ARG_PARSER>
- pattern: $<ARG_PARSER>()
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: $<ARGPARSE>.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

0 comments on commit f52cb55

Please sign in to comment.