aboutsummaryrefslogtreecommitdiffhomepage
path: root/dev/tools/should-check-whitespace.sh
blob: d85d651070b697f17c92190d98ede1cf98883b99 (plain)
1
2
3
4
5
6
#!/usr/bin/env bash

# determine if a file has whitespace checking enabled in .gitattributes

git ls-files --error-unmatch "$1" >/dev/null 2>&1 &&
git check-attr whitespace -- "$1" | grep -q -v -e 'unset$' -e 'unspecified$'