Commit 7f39e3d1 authored by Olivier Robin's avatar Olivier Robin Committed by LUCI CQ

Make swift-format default True on Mac hosts

Also make swift lint strict to catch every formatting errors.

Bug: 1263872
Change-Id: Ie717c1f03ec1a0257cafceecc2055767d0be2077
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3605589Reviewed-by: 's avatarBrian Ryner <bryner@google.com>
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent 381db68a
......@@ -5168,7 +5168,7 @@ def _RunSwiftFormat(opts, swift_diff_files, top_dir, upstream_commit):
cmd = [swift_format_tool]
if opts.dry_run:
cmd.append('lint')
cmd += ['lint', '-s']
else:
cmd += ['format', '-i']
cmd += swift_diff_files
......@@ -5242,7 +5242,7 @@ def CMDformat(parser, args):
'--swift-format',
dest='use_swift_format',
action='store_true',
default=False,
default=swift_format.IsSwiftFormatSupported(),
help='Enables formatting of Swift file types using swift-format '
'(macOS host only).')
parser.add_option(
......
......@@ -40,6 +40,8 @@ def FindSwiftFormatToolInChromiumTree():
def IsSwiftFormatSupported():
if sys.platform != 'darwin':
return False
try:
FindSwiftFormatToolInChromiumTree()
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment