Skip to content

Commit 4e63fd3

Browse files
committed
Create psalm.yml
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com> Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 76f8057 commit 4e63fd3

4 files changed

Lines changed: 1076 additions & 169 deletions

File tree

.github/workflows/psalm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: Static analysis
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- master
13+
- main
14+
- stable*
15+
16+
jobs:
17+
static-analysis:
18+
runs-on: ubuntu-latest
19+
20+
name: Nextcloud
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Set up php
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 7.4
29+
coverage: none
30+
31+
- name: Install dependencies
32+
run: composer i
33+
34+
- name: Run coding standards check
35+
run: composer run psalm

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
"scripts": {
1111
"cs:fix": "php-cs-fixer fix",
1212
"cs:check": "php-cs-fixer fix --dry-run --diff",
13-
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
13+
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
14+
"psalm": "psalm --threads=1",
15+
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
16+
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
17+
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType"
1418
},
1519
"require-dev": {
1620
"nextcloud/coding-standard": "^1.0.0",
17-
"phpunit/phpunit": "^9"
21+
"phpunit/phpunit": "^9",
22+
"vimeo/psalm": "^4.3.2",
23+
"nextcloud/ocp": "dev-master"
1824
}
1925
}

0 commit comments

Comments
 (0)