We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1567784 commit 00a28afCopy full SHA for 00a28af
clang-format-diff.py
@@ -138,6 +138,7 @@ def main():
138
)
139
140
# Reformat files containing changes in place.
141
+ has_diff = False
142
for filename, lines in lines_by_file.items():
143
if args.i and args.verbose:
144
print("Formatting {}".format(filename))
@@ -169,7 +170,7 @@ def main():
169
170
171
stdout, stderr = p.communicate()
172
if p.returncode != 0:
- sys.exit(p.returncode)
173
+ return p.returncode
174
175
if not args.i:
176
with open(filename) as f:
@@ -185,9 +186,12 @@ def main():
185
186
187
diff_string = "".join(diff)
188
if len(diff_string) > 0:
189
+ has_diff = True
190
sys.stdout.write(diff_string)
- sys.exit(1)
191
+
192
+ if has_diff:
193
+ return 1
194
195
196
if __name__ == "__main__":
- main()
197
+ sys.exit(main())
0 commit comments