From 7bf75b9724032f542bd3e242a5de90b4045631be Mon Sep 17 00:00:00 2001 From: provokateurin Date: Sun, 22 Sep 2024 08:38:31 +0200 Subject: [PATCH] fix(psalm): Enable findUnusedBaselineEntry Signed-off-by: provokateurin --- .github/workflows/static-code-analysis.yml | 2 +- .github/workflows/update-psalm-baseline.yml | 67 --------------------- psalm.xml | 2 +- 3 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/update-psalm-baseline.yml diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml index c5e9cced1a9d4..0e294d43214ce 100644 --- a/.github/workflows/static-code-analysis.yml +++ b/.github/workflows/static-code-analysis.yml @@ -64,7 +64,7 @@ jobs: run: composer i - name: Psalm taint analysis - run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --report=results.sarif --taint-analysis + run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --report=results.sarif --taint-analysis --ignore-baseline - name: Upload Security Analysis results to GitHub if: always() diff --git a/.github/workflows/update-psalm-baseline.yml b/.github/workflows/update-psalm-baseline.yml deleted file mode 100644 index d2041c294c7f1..0000000000000 --- a/.github/workflows/update-psalm-baseline.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Update Psalm baseline - -on: - workflow_dispatch: - schedule: - - cron: "5 2 * * *" - -jobs: - update-psalm-baseline: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - fail-fast: false - matrix: - branches: ["master", "stable28", "stable27", "stable26"] - - name: update-psalm-baseline-${{ matrix.branches }} - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - ref: ${{ matrix.branches }} - submodules: true - - - name: Set up php - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 - with: - php-version: '8.0' - extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Composer install - run: composer install - - - name: Psalm - run: composer run psalm:ci -- --monochrome --no-progress --output-format=text --update-baseline - continue-on-error: true - - - name: Psalm OCP - run: composer run psalm:ci -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline - continue-on-error: true - - - name: Reset composer - run: | - git clean -f lib/composer - git checkout composer.json composer.lock lib/composer - - - name: Create Pull Request - uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: Update psalm baseline - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-update-psalm-baseline - title: "[${{ matrix.branches }}] Update psalm-baseline.xml" - body: | - Auto-generated update psalm-baseline.xml with fixed psalm warnings - labels: | - automated pr - 3. to review - team-reviewers: server-backend diff --git a/psalm.xml b/psalm.xml index 5c4c40a158019..a5e644e8bf27e 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,7 +6,7 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config" errorBaseline="build/psalm-baseline.xml" - findUnusedBaselineEntry="false" + findUnusedBaselineEntry="true" findUnusedCode="false" phpVersion="8.0" >