-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ecd7ec
commit 024f7a9
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
# codesniffer (http://pear.php.net/package/PHP_CodeSniffer/redirected) | ||
# esvalidate (https://github.com/duereg/esvalidate) | ||
# CSS lint (https://github.com/stubbornella/csslint/wiki/Command-line-interface) | ||
# SCSS lint (https://github.com/causes/scss-lint) | ||
# | ||
# @version 1.1.0 | ||
# @author Wouter Sioen <[email protected]> | ||
|
@@ -98,6 +99,27 @@ if [ -n "$files" ]; then | |
done | ||
fi | ||
|
||
# fetch all changed css files and validate them | ||
files=$(git diff-index --name-only --diff-filter=ACMR $against | grep -E '\.s(c|a)ss$') | ||
if [ -n "$files" ]; then | ||
|
||
echo | ||
echo 'Checking SCSS Files' | ||
echo '------------------' | ||
echo | ||
|
||
for file in $files; do | ||
output=`scss-lint $file | grep '\[E\]'` | ||
|
||
# if our output is not empty, there were errors | ||
if [ -n "$output" ]; then | ||
echo "$file contains scss syntax errors" | ||
scss-lint $file | grep '\[E\]' | ||
errors=("${errors[@]}" "$output") | ||
fi | ||
done | ||
fi | ||
|
||
# Let's pop our stash. We don't want to lose anything | ||
git stash pop -q | ||
|
||
|