92f7129ae3
presubmit.sh still runs all of them in the same order often I'd like to iterate on analyze or rerun format without running all of the tests, and find myself copying analyze or format lines from test.sh R=leafp@google.com Review URL: https://codereview.chromium.org/1167233002
17 lines
795 B
Bash
Executable File
17 lines
795 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Switch to the root directory of dev_compiler
|
|
cd $( dirname "${BASH_SOURCE[0]}" )/..
|
|
|
|
# Run formatter in rewrite mode on all files that are part of the project.
|
|
# This checks that all files are commited first to git, so no state is lost.
|
|
# The formatter ignores:
|
|
# * local files that have never been added to git,
|
|
# * subdirectories of test/ and tool/, unless explicitly added. Those dirs
|
|
# contain a lot of generated or external source we should not reformat.
|
|
(files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \
|
|
tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \
|
|
&& echo "Did not run the formatter, please commit edited files first." \
|
|
|| (echo "Running dart formatter" ; pub run dart_style:format -w $files))
|