Skip to content

Commit 3abc478

Browse files
committed
[NFC] python_format: Add some useful forwarded options
1 parent 34b6eac commit 3abc478

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

utils/python_format.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def parse_args():
112112
parser.add_argument(
113113
"--check",
114114
action="store_true",
115-
help="Don't format the file, just return the status.",
115+
help="Don't write the files back, just return the status.",
116116
)
117117

118118
parser.add_argument(
@@ -122,6 +122,19 @@ def parse_args():
122122
help="Emit messages to stderr about files that were not changed.",
123123
)
124124

125+
parser.add_argument(
126+
"--diff",
127+
action="store_true",
128+
help="Don't write the files back, just output a diff for each file on stdout.",
129+
)
130+
131+
parser.add_argument(
132+
"-S",
133+
"--skip-string-normalization",
134+
action="store_true",
135+
help="Don't normalize string quotes or prefixes.",
136+
)
137+
125138
return parser.parse_args()
126139

127140

@@ -144,6 +157,10 @@ def main():
144157
command.append("--check")
145158
if args.verbose:
146159
command.append("--verbose")
160+
if args.diff:
161+
command.append("--diff")
162+
if args.skip_string_normalization:
163+
command.append("--skip-string-normalization")
147164

148165
requested_paths = [path.resolve() for path in args.paths]
149166

0 commit comments

Comments
 (0)