From 039334381ea0bd19fcad15d1940af98d0ad51428 Mon Sep 17 00:00:00 2001 From: ThiƩbaud Weksteen Date: Thu, 21 Sep 2023 16:44:52 +1000 Subject: lint_fix: fix CLI arguments use Commit df4cd065 updated how command line arguments are parsed. However, sys.argv[0] should be ignored (as this is the name of the program). Remove the argument, so the default value (sys.argv[1:]) is used. Also, use the embedded_launcher so that the help renders as: usage: lint_fix [-h] instead of: usage: usage: __soong_entrypoint_redirector__.py [-h] Test: lint_fix --print --no-fix --check AnnotatedAidlCounter \ --lint-module AndroidUtilsLintChecker services.autofill Change-Id: I00e3e3b70c9715e363d3448ae84bf9ff161f2306 --- tools/lint/fix/Android.bp | 5 +++++ tools/lint/fix/soong_lint_fix.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/lint/fix/Android.bp b/tools/lint/fix/Android.bp index 43f21221ae5a..ddacf57c3a3e 100644 --- a/tools/lint/fix/Android.bp +++ b/tools/lint/fix/Android.bp @@ -25,6 +25,11 @@ python_binary_host { name: "lint_fix", main: "soong_lint_fix.py", srcs: ["soong_lint_fix.py"], + version: { + py3: { + embedded_launcher: true, + }, + }, } python_library_host { diff --git a/tools/lint/fix/soong_lint_fix.py b/tools/lint/fix/soong_lint_fix.py index b42f9eec99d0..4a2e37e51d71 100644 --- a/tools/lint/fix/soong_lint_fix.py +++ b/tools/lint/fix/soong_lint_fix.py @@ -213,5 +213,5 @@ def _setup_parser(): if __name__ == "__main__": opts = SoongLintFixOptions() - opts.parse_args(sys.argv) + opts.parse_args() SoongLintFix(opts).run() -- cgit v1.2.3-59-g8ed1b