-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
51 lines (51 loc) · 2 KB
/
.drone.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
kind: pipeline
name: DroneForPHP
steps:
- name: Embedded Configuration (Magic Numbers)
image: dockerizedphp/phpmnd
commands:
- phpmnd /drone/src --non-zero-exit-on-violation --extensions=default_parameter,condition,operation,return,argument
- name: CleanCode
image: denisura/phpmd
commands:
# Need to grep out "Unexpected token" errors in newer versions of PHP
# Because the grep exits with error code 0, we have to generate the exit code by parsing the output
- phpmd /drone/src text cleancode | grep -v "Unexpected token" > /tmp/result
- ROWS=`wc -l < /tmp/result`
- cat /tmp/result
- if [ $ROWS -gt 1 ] ; then exit 1 ; fi
- name: CodeSize (Complexity)
image: denisura/phpmd
commands:
# Need to grep out "Unexpected token" errors in newer versions of PHP
# Because the grep exits with error code 0, we have to generate the exit code by parsing the output
- phpmd /drone/src text codesize | grep -v "Unexpected token" > /tmp/result
- ROWS=`wc -l < /tmp/result`
- cat /tmp/result
- if [ $ROWS -gt 1 ] ; then exit 1 ; fi
- name: Unused code
image: denisura/phpmd
commands:
# Need to grep out "Unexpected token" errors in newer versions of PHP
# Because the grep exits with error code 0, we have to generate the exit code by parsing the output
- phpmd /drone/src text unusedcode | grep -v "Unexpected token" > /tmp/result
- ROWS=`wc -l < /tmp/result`
- cat /tmp/result
- if [ $ROWS -gt 1 ] ; then exit 1 ; fi
- name: SOLID Design Rules
image: denisura/phpmd
commands:
# Need to grep out "Unexpected token" errors in newer versions of PHP
# Because the grep exits with error code 0, we have to generate the exit code by parsing the output
- phpmd /drone/src text design | grep -v "Unexpected token" > /tmp/result
- ROWS=`wc -l < /tmp/result`
- cat /tmp/result
- if [ $ROWS -gt 1 ] ; then exit 1 ; fi
- name: Copy paste detection
image: rvannauker/phpcpd
commands:
- phpcpd /drone/src
- name: PSR12
image: cytopia/phpcs:latest-php7.3
commands:
- phpcs --standard=PSR1,PSR12 /drone/src