[NFC] python_format: Add some useful forwarded options

This commit is contained in:
Anthony Latsis
2022-11-22 19:19:58 +03:00
parent 34b6eac727
commit 3abc4789e8

View File

@@ -112,7 +112,7 @@ def parse_args():
parser.add_argument(
"--check",
action="store_true",
help="Don't format the file, just return the status.",
help="Don't write the files back, just return the status.",
)
parser.add_argument(
@@ -122,6 +122,19 @@ def parse_args():
help="Emit messages to stderr about files that were not changed.",
)
parser.add_argument(
"--diff",
action="store_true",
help="Don't write the files back, just output a diff for each file on stdout.",
)
parser.add_argument(
"-S",
"--skip-string-normalization",
action="store_true",
help="Don't normalize string quotes or prefixes.",
)
return parser.parse_args()
@@ -144,6 +157,10 @@ def main():
command.append("--check")
if args.verbose:
command.append("--verbose")
if args.diff:
command.append("--diff")
if args.skip_string_normalization:
command.append("--skip-string-normalization")
requested_paths = [path.resolve() for path in args.paths]