Skip to content

Commit e5abdde

Browse files
committed
Add static analysis
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent d154a50 commit e5abdde

19 files changed

Lines changed: 2883 additions & 566 deletions
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Static analysis
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
static-psalm-analysis:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
ocp-version: [ 'dev-master' ]
11+
name: Nextcloud ${{ matrix.ocp-version }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Set up php
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: 7.4
19+
tools: composer:v1
20+
coverage: none
21+
- name: Install dependencies
22+
run: composer i
23+
- name: Install dependencies
24+
run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
25+
- name: Run coding standards check
26+
run: composer run psalm

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
build/
66
.settings/
77
vendor/
8-
.php_cs.cache
8+
.php-cs-fixer.cache
File renamed without changes.

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@
2525
"scripts": {
2626
"cs:check": "php-cs-fixer fix --dry-run --diff",
2727
"cs:fix": "php-cs-fixer fix",
28+
"psalm": "psalm --threads=1 --update-baseline",
29+
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
30+
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
31+
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
2832
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
2933
},
3034
"require-dev": {
31-
"nextcloud/coding-standard": "^0.5.0",
32-
"phpunit/phpunit": "^9.5"
35+
"phpunit/phpunit": "^9.5",
36+
"vimeo/psalm": "^4.22",
37+
"christophwurst/nextcloud": "dev-master",
38+
"nextcloud/coding-standard": "^1.0"
3339
}
3440
}

0 commit comments

Comments
 (0)