Browse Source
Add Psalm
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/4336/head
Joas Schilling
5 years ago
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
6 changed files with
1123 additions and
34 deletions
-
.github/workflows/psalm.yml
-
Makefile
-
composer.json
-
composer.lock
-
psalm.xml
-
tests/psalm-baseline.xml
|
|
|
@ -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 |
|
|
|
@ -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 \
|
|
|
|
|
|
|
|
@ -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" |
|
|
|
} |
|
|
|
} |
|
|
|
@ -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> |
|
|
|
@ -0,0 +1,2 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
|
<files psalm-version="3.16@d03e5ef057d6adc656c0ff7e166c50b73b4f48f3"/> |