Mass format python with yapf
- Add `.style.yapf` with configuration to use Google style. - Run `yapf` on all `.py` files in this repo. - Manually fix one trailing space in a doc string. - Run `git cl format runtime` to satisfy presubmit. Change-Id: I7e6bd11e91f07926b9188362599af398551eed79 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111600 Commit-Queue: Nate Bosch <nbosch@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
8b2993568e
commit
55f81f2210
@@ -8,27 +8,26 @@ import os
|
||||
import sys
|
||||
import utils
|
||||
|
||||
|
||||
def ParseArgs(args):
|
||||
args = args[1:]
|
||||
parser = argparse.ArgumentParser(
|
||||
description='A script to write the version string to a file')
|
||||
args = args[1:]
|
||||
parser = argparse.ArgumentParser(
|
||||
description='A script to write the version string to a file')
|
||||
|
||||
parser.add_argument('--output', '-o',
|
||||
type=str,
|
||||
required=True,
|
||||
help='File to write')
|
||||
parser.add_argument(
|
||||
'--output', '-o', type=str, required=True, help='File to write')
|
||||
|
||||
return parser.parse_args(args)
|
||||
return parser.parse_args(args)
|
||||
|
||||
|
||||
def Main(argv):
|
||||
args = ParseArgs(argv)
|
||||
revision = utils.GetGitRevision()
|
||||
if revision is not None:
|
||||
with open(args.output, 'w') as f:
|
||||
f.write('%s\n' % revision)
|
||||
return 0
|
||||
args = ParseArgs(argv)
|
||||
revision = utils.GetGitRevision()
|
||||
if revision is not None:
|
||||
with open(args.output, 'w') as f:
|
||||
f.write('%s\n' % revision)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(Main(sys.argv))
|
||||
sys.exit(Main(sys.argv))
|
||||
|
||||
Reference in New Issue
Block a user