mirror of
https://github.com/zulip/zulip.git
synced 2025-10-22 20:42:14 +00:00
semgrep: Lint unnecessary type=str in argparse.
This commit is contained in:
committed by
Tim Abbott
parent
1e943ae7df
commit
75c0f0286f
@@ -379,3 +379,15 @@ rules:
|
|||||||
- pattern: urllib.parse.ParseResult
|
- pattern: urllib.parse.ParseResult
|
||||||
severity: ERROR
|
severity: ERROR
|
||||||
message: "Use urlsplit rather than urlparse"
|
message: "Use urlsplit rather than urlparse"
|
||||||
|
|
||||||
|
- id: argparse-redundant-str
|
||||||
|
patterns:
|
||||||
|
- pattern: |
|
||||||
|
....add_argument(..., type=str, ...)
|
||||||
|
message: |
|
||||||
|
The `type=str` argument is redundant in `argparse` because `str` is the default type.
|
||||||
|
fix-regex:
|
||||||
|
regex: ',\s*type=str'
|
||||||
|
replacement: ""
|
||||||
|
languages: [python]
|
||||||
|
severity: ERROR
|
||||||
|
Reference in New Issue
Block a user