-
Notifications
You must be signed in to change notification settings - Fork 71
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
Suppress UnusedClass/PossiblyUnusedMethod on well-known classes/methods of fresh Laravel/Lumen projects #183
Conversation
* @var array<string, list<class-string>> | ||
*/ | ||
private const BY_CLASS = [ | ||
'UnusedClass' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these are still emitted if the bootstrap/app.php
file is analyzed? Thinking out loud..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, bootstrap/app.php
does use App\Console\Kernel
, App\Exceptions\Handler
and App\Http\Kernel
. And some of the other classes are used in config/app.php
.
So maybe it is worth adding those directories to the tests/(laravel|lumen)-test-psalm.xml
configs. 🤔
In my project, I have configured <projectFiles>
likes this, probably due to too many errors (and some of this could explain some of the weird errors I have experienced):
<projectFiles>
<directory name="."/>
<ignoreFiles allowMissingFiles="true">
<directory name="app/Http/Middleware"/>
<directory name="bootstrap/cache"/>
<directory name="cache"/>
<directory name="config"/>
<directory name="database"/>
<directory name="node_modules"/>
<directory name="routes"/>
<directory name="storage"/>
<directory name="tests"/>
<directory name="vendor"/>
<directory name="vendor-bin"/>
<file name="bootstrap/app.php"/>
<file name="public/index.php"/>
<file name="server.php"/>
</ignoreFiles>
</projectFiles>
edit: Ideally, we would support as much files as possible, and make a recommendation in the README
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, didn't view that as a blocker for this PR, but something we should consider!
This is awesome! Thanks a lot for your help |
Fixes #53.