blob: 364bee71d3b3025b0cf1dfc8a82e3d41cccdc919 [file] [log] [blame]
#!/bin/bash
# Make sure dartfmt is run on everything
# This assumes you have dart_style as a dev_dependency
echo "Checking dartfmt..."
NEEDS_DARTFMT="$(find lib test -name "*.dart" | xargs pub run dart_style:format -n)"
if [[ ${NEEDS_DARTFMT} != "" ]]
then
echo "FAILED"
echo "${NEEDS_DARTFMT}"
exit 1
fi
echo "PASSED"
# Make sure we pass the analyzer
echo "Checking dartanalyzer..."
FAILS_ANALYZER="$(find lib test -name "*.dart" | xargs dartanalyzer --options .analysis_options)"
if [[ $FAILS_ANALYZER == *"[error]"* ]]
then
echo "FAILED"
echo "${FAILS_ANALYZER}"
exit 1
fi
echo "PASSED"
# Fail on anything that fails going forward.
set -e
pub run test