mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
feat(psalm): Add strict config for new code
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
d56b24112e
commit
3d09e8d912
3 changed files with 58 additions and 0 deletions
27
.github/workflows/static-code-analysis.yml
vendored
27
.github/workflows/static-code-analysis.yml
vendored
|
|
@ -149,3 +149,30 @@ jobs:
|
|||
|
||||
- name: Psalm
|
||||
run: composer run psalm:ncu -- --threads=1 --monochrome --no-progress --output-format=github
|
||||
|
||||
static-code-analysis-strict:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
if: ${{ github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 #v2.35.4
|
||||
with:
|
||||
php-version: '8.2'
|
||||
extensions: ctype,curl,dom,fileinfo,gd,imagick,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Composer install
|
||||
run: composer i
|
||||
|
||||
- name: Psalm
|
||||
run: composer run psalm:strict -- --threads=1 --monochrome --no-progress --output-format=github
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
"psalm": "psalm --no-cache --threads=$(nproc)",
|
||||
"psalm:ocp": "psalm --no-cache --threads=$(nproc) -c psalm-ocp.xml",
|
||||
"psalm:ncu": "psalm --no-cache --threads=$(nproc) -c psalm-ncu.xml",
|
||||
"psalm:strict": "psalm --no-cache --threads=$(nproc) -c psalm-strict.xml",
|
||||
"psalm:security": "psalm --no-cache --threads=$(nproc) --taint-analysis --use-baseline=build/psalm-baseline-security.xml",
|
||||
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
|
||||
"psalm:update-baseline": "psalm --no-cache --threads=$(nproc) --update-baseline",
|
||||
|
|
|
|||
30
psalm-strict.xml
Normal file
30
psalm-strict.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
<psalm
|
||||
errorLevel="1"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config"
|
||||
resolveFromConfigFile="false"
|
||||
findUnusedBaselineEntry="true"
|
||||
findUnusedCode="false"
|
||||
findUnusedPsalmSuppress="true"
|
||||
findUnusedVariablesAndParams="true"
|
||||
phpVersion="8.2"
|
||||
>
|
||||
<projectFiles>
|
||||
<ignoreFiles>
|
||||
<directory name="apps/**/composer"/>
|
||||
<directory name="apps/**/tests"/>
|
||||
<directory name="lib/composer"/>
|
||||
<directory name="lib/l10n"/>
|
||||
<directory name="3rdparty"/>
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
<extraFiles>
|
||||
<directory name="3rdparty"/>
|
||||
</extraFiles>
|
||||
</psalm>
|
||||
Loading…
Reference in a new issue