Skip to content

Commit a3ec1b5

Browse files
authored
Merge pull request #19 from colinodell/scrutinizer-ci
Scrutinizer CI
2 parents f542afa + 0d97a07 commit a3ec1b5

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/.gitattributes export-ignore
77
/.github export-ignore
88
/.gitignore export-ignore
9+
/.scrutinizer.yml export-ignore
910
/phpcs.xml.dist export-ignore
1011
/phpstan.neon.dist export-ignore
1112
/phpunit.xml.dist export-ignore

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ jobs:
6060
- run: vendor/bin/phpunit --no-coverage
6161
if: ${{ matrix.coverage == 'none' }}
6262

63-
- run: vendor/bin/phpunit --coverage-text
63+
- run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
64+
if: ${{ matrix.coverage != 'none' }}
65+
66+
- run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
6467
if: ${{ matrix.coverage != 'none' }}
6568

6669
phpstan:

.scrutinizer.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
build:
4+
nodes:
5+
analysis:
6+
tests:
7+
override:
8+
- php-scrutinizer-run
9+
checks:
10+
php:
11+
code_rating: true
12+
remove_extra_empty_lines: true
13+
remove_php_closing_tag: true
14+
remove_trailing_whitespace: true
15+
fix_use_statements:
16+
remove_unused: true
17+
preserve_multiple: false
18+
preserve_blanklines: true
19+
order_alphabetically: true
20+
fix_php_opening_tag: true
21+
fix_linefeed: true
22+
fix_line_ending: true
23+
fix_identation_4spaces: true
24+
fix_doc_comments: true
25+
tools:
26+
external_code_coverage:
27+
timeout: 1800
28+
runs: 3
29+
php_analyzer: true
30+
php_code_coverage: false
31+
php_code_sniffer:
32+
config:
33+
standard: PSR12
34+
filter:
35+
paths: ['src']
36+
php_cpd:
37+
enabled: true
38+
excluded_dirs: [vendor, tests]
39+
php_loc:
40+
enabled: true
41+
excluded_dirs: [vendor, tests]
42+
php_pdepend: true
43+
php_sim: true
44+

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"require-dev": {
2929
"phpstan/phpstan": "^0.12.42",
3030
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
31+
"scrutinizer/ocular": "1.6.0",
3132
"squizlabs/php_codesniffer": "^3.5",
3233
"vimeo/psalm": "^3.14"
3334
},

0 commit comments

Comments
 (0)