Skip to content

Commit

Permalink
ci: reactivate psalm (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Oct 10, 2023
1 parent 7155106 commit 8f16d6b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 74 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ on:
types: [opened, synchronize, reopened]

jobs:
# psalm:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# php-version: ['8.1']
psalm:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.2']

# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
steps:
- name: Checkout sources
uses: actions/checkout@v4

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

# - name: Get Composer Cache Directory
# id: composer-cache
# run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
# - name: Cache composer files
# uses: actions/cache@v3
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}
# restore-keys: |
# ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}
# ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}
# ${{ runner.os }}-composer-v4-
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}
restore-keys: |
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}
${{ runner.os }}-composer-v4-
# - name: Install dependencies
# run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader

# - name: Run psalm
# run: vendor/bin/psalm --output-format=github
- name: Run psalm
run: vendor/bin/psalm --output-format=github


phpstan:
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5 || ^10.0",
"psalm/plugin-laravel": "^2.8",
"xheaven/composer-git-hooks": "^3.1"
},
"suggest": {
Expand Down
50 changes: 4 additions & 46 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<directory name="routes"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
Expand All @@ -14,49 +17,4 @@
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
</plugins>

<issueHandlers>
<LessSpecificReturnType errorLevel="info"/>

<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->

<DeprecatedMethod errorLevel="info"/>
<DeprecatedProperty errorLevel="info"/>
<DeprecatedClass errorLevel="info"/>
<DeprecatedConstant errorLevel="info"/>
<DeprecatedInterface errorLevel="info"/>
<DeprecatedTrait errorLevel="info"/>

<InternalMethod errorLevel="info"/>
<InternalProperty errorLevel="info"/>
<InternalClass errorLevel="info"/>

<MissingClosureReturnType errorLevel="info"/>
<MissingReturnType errorLevel="info"/>
<MissingPropertyType errorLevel="info"/>
<InvalidDocblock errorLevel="info"/>

<PropertyNotSetInConstructor errorLevel="info"/>
<MissingConstructor errorLevel="info"/>
<MissingClosureParamType errorLevel="info"/>
<MissingParamType errorLevel="info"/>

<RedundantCondition errorLevel="info"/>

<DocblockTypeContradiction errorLevel="info"/>
<RedundantConditionGivenDocblockType errorLevel="info"/>

<UnresolvableInclude errorLevel="info"/>

<RawObjectIteration errorLevel="info"/>

<InvalidStringClass errorLevel="info"/>

<NoInterfaceProperties>
<errorLevel type="suppress">
<file name="src/Services/Webauthn/CreationOptionsFactory.php"/>
</errorLevel>
</NoInterfaceProperties>

</issueHandlers>
</psalm>

0 comments on commit 8f16d6b

Please sign in to comment.