Browse Source

Add Psalm

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/4336/head
Joas Schilling 5 years ago
parent
commit
3b9deaae79
No known key found for this signature in database GPG Key ID: 7076EA9751AACDDA
  1. 23
      .github/workflows/psalm.yml
  2. 1
      Makefile
  3. 9
      composer.json
  4. 1087
      composer.lock
  5. 35
      psalm.xml
  6. 2
      tests/psalm-baseline.xml

23
.github/workflows/psalm.yml

@ -0,0 +1,23 @@
name: Static analysis
on: [push]
jobs:
static-psalm-analysis:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'dev-master' ]
name: Nextcloud ${{ matrix.ocp-version }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php
uses: shivammathur/setup-php@master
with:
php-version: 7.4
coverage: none
- name: Install dependencies
run: composer i
- name: Install dependencies
run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
- name: Run coding standards check
run: composer run psalm

1
Makefile

@ -79,6 +79,7 @@ appstore:
--exclude=package-lock.json \
--exclude=.php_cs.dist \
--exclude=.php_cs.cache \
--exclude=psalm.xml \
--exclude=README.md \
--exclude=src \
--exclude=.stylelintignore \

9
composer.json

@ -2,9 +2,14 @@
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l"
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType"
},
"minimum-stability": "dev",
"require-dev": {
"nextcloud/coding-standard": "^0.3.0"
"nextcloud/coding-standard": "^0.3.0",
"vimeo/psalm": "^3.16",
"christophwurst/nextcloud": "dev-master"
}
}

1087
composer.lock
File diff suppressed because it is too large
View File

35
psalm.xml

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
errorLevel="5"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="tests/psalm-baseline.xml"
>
<projectFiles>
<directory name="lib" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<extraFiles>
<directory name="vendor" />
</extraFiles>
<issueHandlers>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="OC" />
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<referencedClass name="Doctrine\DBAL\Schema\Schema" />
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
<referencedClass name="Doctrine\DBAL\Driver\Statement" />
<referencedClass name="Doctrine\DBAL\Schema\Table" />
</errorLevel>
</UndefinedDocblockClass>
</issueHandlers>
</psalm>

2
tests/psalm-baseline.xml

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.16@d03e5ef057d6adc656c0ff7e166c50b73b4f48f3"/>
Loading…
Cancel
Save