Skip to content

Commit

Permalink
Add plugin for psalm to detect insane comparisons
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Sep 27, 2021
1 parent ee49498 commit f435637
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 122 deletions.
9 changes: 5 additions & 4 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
errorBaseline="build/psalm-baseline.xml"
>
<plugins>
<plugin filename="build/psalm/AppFrameworkTainter.php" />
<plugin filename="build/psalm/AppFrameworkTainter.php"/>
<pluginClass class="Orklah\PsalmInsaneComparison\Plugin"/>
</plugins>
<projectFiles>
<directory name="apps/accessibility"/>
Expand Down Expand Up @@ -115,14 +116,14 @@
<referencedVariable name="$l"/>
<referencedVariable name="$theme"/>
<!-- false positive: https://github.com/nextcloud/server/blob/cb057829f72c70e819f456edfadbb29d72dba832/lib/private/Console/Application.php#L92 -->
<file name="core/register_command.php" />
<file name="core/register_command.php"/>
</errorLevel>
</UndefinedGlobalVariable>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<!-- Helper classes for sharing API integration from other apps -->
<referencedClass name="OCA\Deck\Sharing\ShareAPIHelper" />
<referencedClass name="OCA\Talk\Share\Helper\DeletedShareAPIController" />
<referencedClass name="OCA\Deck\Sharing\ShareAPIHelper"/>
<referencedClass name="OCA\Talk\Share\Helper\DeletedShareAPIController"/>
</errorLevel>
</UndefinedDocblockClass>
</issueHandlers>
Expand Down
9 changes: 6 additions & 3 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"php": "7.3"
}
},
"require": {
"vimeo/psalm": "4.8.1"
}
"require": {
"vimeo/psalm": "4.8.1"
},
"require-dev": {
"orklah/psalm-insane-comparison": "^1.0"
}
}
Loading

0 comments on commit f435637

Please sign in to comment.