diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-12-29 17:27:39 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-12-29 17:27:39 +0300 |
commit | 21506c39f865b1fb3ac8315d9a2926d28244557e (patch) | |
tree | 9aa6a83854ed7842cbfbb0f1da13901801a5be4e | |
parent | edbd604ebc0094f48ab735da3e449625f8f6cfd9 (diff) |
Add psalm
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | .github/workflows/static-analysis.yml | 26 | ||||
-rw-r--r-- | composer.json | 6 | ||||
-rw-r--r-- | composer.lock | 33 | ||||
-rw-r--r-- | psalm.xml | 15 |
4 files changed, 77 insertions, 3 deletions
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 000000000..4f40268c6 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,26 @@ +name: Static analysis + +on: [pull_request] + +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 + tools: composer:v1 + 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 diff --git a/composer.json b/composer.json index a7a1ef631..e7d6595e1 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,8 @@ "roave/security-advisories": "dev-master", "christophwurst/nextcloud": "^20.0", "jakub-onderka/php-parallel-lint": "^1.0.0", - "nextcloud/coding-standard": "^0.4.0" + "nextcloud/coding-standard": "^0.4.0", + "psalm/phar": "^4.3" }, "license": "AGPLv3", "authors": [ @@ -18,6 +19,7 @@ "scripts": { "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l", "cs:check": "php-cs-fixer fix --dry-run --diff", - "cs:fix": "php-cs-fixer fix" + "cs:fix": "php-cs-fixer fix", + "psalm": "psalm.phar" } } diff --git a/composer.lock b/composer.lock index 4b01c3ce0..569cacd09 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa6cd47af0015137fd6c4a376ffbad34", + "content-hash": "a3b7237135c9dd17a5f98f968b21155d", "packages": [], "packages-dev": [ { @@ -562,6 +562,37 @@ "time": "2020-10-14T08:39:05+00:00" }, { + "name": "psalm/phar", + "version": "4.3.1", + "source": { + "type": "git", + "url": "https://github.com/psalm/phar.git", + "reference": "f61d8f0eaaf5f7c26f1269ddeaf1fbe29dff1bee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/phar/zipball/f61d8f0eaaf5f7c26f1269ddeaf1fbe29dff1bee", + "reference": "f61d8f0eaaf5f7c26f1269ddeaf1fbe29dff1bee", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "vimeo/psalm": "*" + }, + "bin": [ + "psalm.phar" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer-based Psalm Phar", + "time": "2020-12-03T21:44:12+00:00" + }, + { "name": "psr/container", "version": "1.0.0", "source": { diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 000000000..3cda83ef2 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<psalm + errorLevel="4" + 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" /> + </projectFiles> + <extraFiles> + <directory name="vendor" /> + </extraFiles> +</psalm> |