-
Notifications
You must be signed in to change notification settings - Fork 2
/
check
executable file
·39 lines (32 loc) · 890 Bytes
/
check
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
39
#!/bin/bash
set -e
ask_run() {
read -p "$1 \`$2\`. Run it now (Y/n)? " run
case ${run:0:1} in
y|Y )
$2
;;
esac
}
if (./vendor/bin/pint --test > /dev/null 2>/dev/null); then
echo 'pint OK'
else
echo 'pint FAIL'
ask_run 'pint can attempt to fix the issues with' './vendor/bin/pint'
fi
if (./vendor/bin/phpcs ./ > /dev/null 2>/dev/null); then
echo 'PHPCS OK'
else
echo 'PHPCS FAIL'
ask_run 'More information available with' './vendor/bin/phpcs ./'
ask_run 'Attempt to fix issues with' './vendor/bin/phpcbf ./'
fi
if (./vendor/bin/phpstan analyse > /dev/null 2>/dev/null); then
echo 'PHPStan OK'
else
echo 'PHPStan FAIL'
ask_run 'More information available with' './vendor/bin/phpstan analyse'
fi
ask_run 'Unit test suite available with' 'vendor/bin/phpunit'
echo '=================='
echo 'Everything Complete'