Skip to content

Commit

Permalink
Convert format script to Dart (flutter#20572)
Browse files Browse the repository at this point in the history
This converts the ci/format.sh script to a Dart script that uses process_runner and isolates to multi-process the clang-format, diffs, and grepping needed to do the formatting changes.

It also will (by default) only check the formatting of changed files.

The user can optionally check all files (--all-files) or do only some types of checks with --check. --verbose prints the versions of the tools used for Clang format and Java format.

Specifying --fix will cause any formatting errors that would have been detected to be fixed.
  • Loading branch information
gspencergoog authored Aug 18, 2020
1 parent 17e1ae4 commit 35640af
Show file tree
Hide file tree
Showing 7 changed files with 985 additions and 280 deletions.
8 changes: 4 additions & 4 deletions build/generate_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def RemoveIfExists(path):

def main():
parser = argparse.ArgumentParser();

parser.add_argument('-t', '--tests', nargs='+', dest='tests',
required=True, help='The unit tests to run and gather coverage data on.')
parser.add_argument('-o', '--output', dest='output',
Expand All @@ -64,19 +64,19 @@ def main():
# Run all unit tests and collect raw profiles.
for test in args.tests:
absolute_test_path = os.path.abspath(test)

if not os.path.exists(absolute_test_path):
print("Path %s does not exist." % absolute_test_path)
return -1

binaries.append(absolute_test_path)

raw_profile = absolute_test_path + ".rawprofile"

RemoveIfExists(raw_profile)

print "Running test %s to gather profile." % os.path.basename(absolute_test_path)

subprocess.check_call([absolute_test_path], env={
"LLVM_PROFILE_FILE": raw_profile
})
Expand Down
Loading

0 comments on commit 35640af

Please sign in to comment.