-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy path.scrutinizer.yml
253 lines (246 loc) · 7.21 KB
/
.scrutinizer.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# @see https://scrutinizer-ci.com/docs/configuration/build_reference
build:
nodes:
analysis:
tests:
override:
# Add the respective Scrutinizer analysis for your language like
- js-scrutinizer-run
- php-scrutinizer-run
dependencies:
before:
# Disable warnings of "The function *** was not found" which suggests inserting `/** @scrutinizer ignore-call */`.
# @see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/analyzing-wordpress
- composer require --dev johnpbloch/wordpress
# test-with-php54:
# environment:
# php:
# version: 5.4
test-with-php56:
dependencies:
# Without this, the following error occurs:
# apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
# @see https://askubuntu.com/a/536141
before:
- sudo apt-get install -y libapache2-mod-php5
environment:
php:
version: 5.6
test-with-php72:
environment:
php:
version: 7.2
test-with-php73:
environment:
php:
version: 7.3
test-with-php74:
tests:
override:
- command: bash ./test/run.sh -c ./test/settings.scrutinizer.cfg
# coverage:
# file: ./coverage.xml
# format: clover
# test-with-php80:
# # @see https://prinsfrank.nl/2022/02/04/Configuring-PHP8.1-on-scrutinizer
# # @see https://scrutinizer-ci.com/docs/guides/upgrading-trusty-image
# image: default-bionic
# environment:
# php:
# version: 8.0
# dependencies:
# # Without this, the following error occurs:
# # service apache2 start: The command exited with code 1. Failed to start apache2.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
# # @see https://askubuntu.com/a/886603
# before:
# - sudo systemctl reload apache2
# test-with-php81:
# image: default-bionic
# environment:
# php:
# version: 8.1.2
# dependencies:
# # Without this, the following error occurs:
# # service apache2 start: The command exited with code 1. Failed to start apache2.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
# # @see https://askubuntu.com/a/886603
# before:
# - sudo systemctl reload apache2
test-with-php74-mu:
environment:
variables:
WP_VERSION: latest
WP_MULTISITE: 1
services:
# mysql: 5.7
mariadb: 10
# dependencies:
# before:
# - cd ./test
# - composer install --no-interaction
# - cd ../
environment:
hosts:
local.dev: '127.0.0.1'
variables:
WP_VERSION: latest
WP_MULTISITE: 0
TEMP: /tmp
php:
version: 7.4
apache2:
modules: ['rewrite']
sites:
symfony_app:
web_root: 'web/'
host: 'local.dev'
# Follows the same structure like the dependencies section.
# Used for running your tests and open-source analysis tools.
# We will execute all commands even if one of them fails.
tests:
# If true, tests execution will stop by any command failure. @see https://scrutinizer-ci.com/docs/build/stop_tests_running_on_failure
stop_on_failure: true
before:
-
command: service apache2 start
-
command: bash ./test/install.sh -c ./test/settings.scrutinizer.cfg
# before:
# - command:
# stop_on_failure: true # If true, tests execution will stop when this command failed.
override:
- bash ./test/run.sh -c ./test/settings.scrutinizer.cfg;
# after: [ ]
# Used for deployment.
# Will only be executed if all tests succeeded.
# If run in parallel, will be executed in the container where tests finish last.
# deployment:
# - # Optional. If this should only be executed for pushes to a certain branch.
# branch: master # The branch name is exactly "master"
# branch: '/^feature/' # Any branch name that starts with "feature"
# commands:
# - aws s3 cp my-file s3://my-bucket/my-file
# - git push heroku master
# - or-any-other-command
checks:
php:
code_rating: true
duplication: false
#tools:
# php_sim: true
# php_pdepend: true
# php_analyzer: true
# php_code_coverage: true # must be removed if using external code coverage
# external_code_coverage:
# timeout: 1800 # 30 minutes (in seconds.)
filter:
excluded_paths:
- 'library/*'
- 'tool/*'
- 'test/*'
- 'example/*'
- '*/library/*'
- '*.bundle.js'
- '*.min.js'
dependency_paths:
# @see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/analyzing-wordpress
- wordpress/
- veondor/
- library/
- node_modules/
coding_style:
php:
indentation:
general:
use_tabs: false
size: 4
switch:
indent_case: true
spaces:
before_parentheses:
function_declaration: false
closure_definition: false
function_call: false
if: true
for: true
while: true
switch: true
catch: true
array_initializer: false
around_operators:
assignment: true
logical: true
equality: true
relational: true
bitwise: true
additive: true
multiplicative: true
shift: true
unary_additive: false
concatenation: false
negation: false
before_left_brace:
class: true
function: true
if: true
else: true
for: true
while: true
do: true
switch: true
try: true
catch: true
finally: true
before_keywords:
else: true
while: true
catch: true
finally: true
within:
brackets: true
array_initializer: true
grouping: true
function_call: true
function_declaration: true
if: true
for: true
while: true
switch: true
catch: true
type_cast: true
ternary_operator:
before_condition: true
after_condition: true
before_alternative: true
after_alternative: true
in_short_version: false
other:
before_comma: false
after_comma: true
before_semicolon: false
after_semicolon: true
after_type_cast: true
braces:
classes_functions:
class: end-of-line
function: end-of-line
closure: end-of-line
if:
opening: end-of-line
always: true
else_on_new_line: false
for:
opening: end-of-line
always: true
while:
opening: end-of-line
always: true
do_while:
opening: end-of-line
always: true
while_on_new_line: false
switch:
opening: end-of-line
try:
opening: end-of-line
catch_on_new_line: false
finally_on_new_line: false