Skip to content

Instantly share code, notes, and snippets.

@DanielHeath
Created December 23, 2015 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielHeath/b51088b76a38087a7804 to your computer and use it in GitHub Desktop.
Save DanielHeath/b51088b76a38087a7804 to your computer and use it in GitHub Desktop.
echo "${BOLD}Checking for missing @flow comments${END}"
HAVE_FLOW=true
for file in $( git ls-files '**/*.js' ); do
if [ -e "$file" ] ; then
read flowtype < "$file"
if test "x$flowtype" = 'x/* flow:disable */'; then
echo "Skipping disabled file $file" > /dev/null
elif test "x$flowtype" != 'x/* @flow */'; then
HAVE_FLOW=false
cat << EOF
$file is not annotated for flowtype (must be the first line)! - got "$flowtype"
EOF
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment