Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switching on phpstan v2 level 10 #31764

Merged
merged 40 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ec8a4bd
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
6af7782
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
7c9b2db
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
5843f2d
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
32d113a
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
16f2e66
switching on phpstan v2 level 10
frederic34 Nov 11, 2024
4eea831
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 11, 2024
1d7b021
version
frederic34 Nov 11, 2024
c2a2039
Merge branch 'develop' into phpstan_v2
frederic34 Nov 11, 2024
466d6a2
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 11, 2024
c5c5e82
Merge remote-tracking branch 'origin/phpstan_v2' into phpstan_v2
frederic34 Nov 11, 2024
17f8203
fix phpstan
frederic34 Nov 11, 2024
673c1c4
fix phpstan
frederic34 Nov 11, 2024
4b8fb9f
test
frederic34 Nov 12, 2024
da077a2
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 12, 2024
03a5052
test
frederic34 Nov 12, 2024
6b6ab91
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 12, 2024
7bc8a52
test
frederic34 Nov 12, 2024
493b1fd
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 12, 2024
6aaee4e
test
frederic34 Nov 12, 2024
144d930
test
frederic34 Nov 12, 2024
b897c26
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 12, 2024
2f1c0a5
Merge branch 'develop' into phpstan_v2
frederic34 Nov 12, 2024
49fedc6
fix
frederic34 Nov 12, 2024
86a68d6
fix
frederic34 Nov 12, 2024
3097f03
fix
frederic34 Nov 12, 2024
05231c8
fix
frederic34 Nov 12, 2024
7851d2a
fix
frederic34 Nov 12, 2024
67377ce
fix
frederic34 Nov 12, 2024
1693b6f
fix
frederic34 Nov 12, 2024
718a70e
add action to refresh phpstan baseline
frederic34 Nov 12, 2024
68250f2
add action to refresh phpstan baseline
frederic34 Nov 12, 2024
a153cfe
Merge remote-tracking branch 'upstream/develop' into phpstan_v2
frederic34 Nov 12, 2024
8278306
add action to refresh phpstan baseline
frederic34 Nov 12, 2024
698a8ae
add action to refresh phpstan baseline
frederic34 Nov 12, 2024
618e86c
fix phpstan
frederic34 Nov 12, 2024
381d30c
fix phpstan
frederic34 Nov 12, 2024
6e43915
fix phpstan
frederic34 Nov 12, 2024
e9e184c
fix phpstan
frederic34 Nov 12, 2024
1e726c2
update baseline
frederic34 Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ trim_trailing_whitespace = false
indent_style = tab
trim_trailing_whitespace = true
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
10 changes: 8 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Get PHP and addons
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpstan:1.12, cs2pr
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt

Expand Down Expand Up @@ -86,3 +86,9 @@ jobs:
name: phpstan-srcrt
path: ${{ github.workspace }}/_stan.xml
retention-days: 2
# Run PHPStan generate baseline
# - name: Run PHPStan generate baseline
# id: phpstan-baseline
# if: ${{ success() }}
# run: |
# phpstan -vv analyse --memory-limit 7G -a build/phpstan/bootstrap_action.php --generate-baseline build/phpstan/phpstan-baseline.neon
73 changes: 73 additions & 0 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 'PHPStan'

on:
# Every Monday we want to refresh the baseline
schedule:
- cron: '0 6 * * 1'

# We want to be able to manually refresh the baseline too
workflow_dispatch:

workflow_call:
inputs:
gh_event:
required: true
type: string
# Run PHPStan analyse on pull requests
pull_request:

env:
PHP_VERSION: '8.2'
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:
fail-fast: true
# Restore old cache
- name: Restore phpstan cache
id: cache
uses: actions/cache/restore@v4
with:
path: ./.github/tmp
key: phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-${{
github.run_id }}
restore-keys: |
phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.head_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.base_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.PAT_GITHUB_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: [email protected]
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
This PR is automatically created to cleanup our baseline.

Since the last refresh of the baseline we have fixed {0} ignored errors.

Keep it up all! :muscle:

There are only {1} ignored errors left :sweat_smile:
Loading
Loading