forked from papyros/qml-material
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·38 lines (26 loc) · 721 Bytes
/
lint.sh
File metadata and controls
executable file
·38 lines (26 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash
tempdir=$(mktemp -d /tmp/$REPO_NAME.XXXX)
qmlfiles=$(find modules -type f -name \*qml -print)
jsfiles=$(find modules -type f -name \*js -print)
pyfiles=$(find modules -type f -name \*py -print)
fail=0
echo ">>> Checking QML files using qmllint"
for file in $qmlfiles; do
qmllint $file || fail=1
done
echo ">>> Checking Python files using pyflakes and pep8"
for file in $pyfiles; do
pyflakes $file || fail=1
pep8 $file || fail=1
done
echo ">>> Checking Javascript files using jshint"
srcdir=$(pwd)
cd $tempdir
for file in $jsfiles; do
mkdir -p $(dirname $file)
sed "s/\.pragma .*//g; s/\.import .*//g" < $srcdir/$file > $file
jshint $file || fail=1
done
if [[ $fail == 1 ]]; then
exit 1
fi