Skip to content

Commit 72c9aa2

Browse files
fix: use CommunityAnalyzerArgs instance to prevent state leaking across calls
argparse only sets defaults when the attribute doesn't already exist on the namespace. Using the class directly meant attributes set by one call (e.g. analyzer="kube-linter") persisted on the class and were not reset to None on subsequent calls without --analyzer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e859755 commit 72c9aa2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

run_community_analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def main(argv: list[str] | None = None) -> None:
6565
help="Which community analyzer to run. Example: 'kube-linter'",
6666
required=False,
6767
)
68-
args = parser.parse_args(argv, namespace=CommunityAnalyzerArgs)
68+
args = parser.parse_args(argv, namespace=CommunityAnalyzerArgs())
6969
# analyzer name is mandatory in case of community analyzers but not custom analyzers
7070
if analyzer_name := args.analyzer:
7171
issue_map_path = get_issue_map(analyzer_name)

0 commit comments

Comments
 (0)