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

[WIP] Phpstan Plugin v3 #66

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 5 additions & 6 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@ on:

jobs:
phpstan:
name: Analyze PHP ${{ matrix.php-versions }} (${{ matrix.refs == 'pr-head' && github.head_ref || github.base_ref || github.ref_name }})
name: Analyze PHP (${{ matrix.refs == 'pr-head' && github.head_ref || github.base_ref || github.ref_name }})
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
refs: ['target-branch', 'pr-head']
exclude:
- refs: ${{ github.event_name != 'pull_request' && 'pr-head' }}
php-versions: ['8.2', '8.3', '8.4']
fballiano marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: latest

- uses: actions/checkout@v4
with:
Expand All @@ -47,10 +46,10 @@ jobs:
uses: actions/cache/restore@v4
with:
path: var
key: phpstan-result-cache-${{ matrix.php-versions }}-${{ matrix.refs }}-${{ github.ref_name }}-${{ github.run_id }}
key: phpstan-result-cache-${{ matrix.refs }}-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
phpstan-result-cache-${{ matrix.php-versions }}-${{ matrix.refs }}-${{ github.ref_name }}
phpstan-result-cache-${{ matrix.php-versions }}-target-branch-main
phpstan-result-cache-${{ matrix.refs }}-${{ github.ref_name }}
phpstan-result-cache-target-branch-main

- name: PHPStan Static Analysis
run: XDEBUG_MODE=off php vendor/bin/phpstan.phar analyze -vvv
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@
/vendor

# PHP-CS-Fixer
.php-cs-fixer.cache
.php-cs-fixer.cache

# PhpStan
.phpstan*.neon
phpstan*.neon
!.phpstan.dist*.neon
10 changes: 3 additions & 7 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
<ruleset name="OpenMage" namespace="OpenMage\CS\Standard">
<config name="testVersion" value="8.2-"/>
<file>maho</file>
<file>app/bootstrap.php</file>
<file>app/Mage.php</file>
<file>app/code/core/Mage/</file>
<file>lib/Mage/</file>
<file>lib/MahoCLI/</file>
<file>lib/Varien/</file>
<file>app</file>
<file>lib</file>
<file>public/api.php</file>
<file>public/index.php</file>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>public/api.php</exclude-pattern>
<exclude-pattern>public/index.php</exclude-pattern>
<exclude-pattern>app/Mage.php</exclude-pattern>
<exclude-pattern>app/bootstrap.php</exclude-pattern>
</rule>
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength.TooLong"/>
Expand Down
Loading