Skip to content

[dx] show type coverage only if full paths are analysed, to avoid spamming output #51

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

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

TomasVotruba
Copy link
Owner

No description provided.

@TomasVotruba TomasVotruba changed the title bump Bump Jan 6, 2025

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
…mming output
@TomasVotruba TomasVotruba force-pushed the tv-avoid-spamming-for-subset branch from 1a87e73 to bb41117 Compare January 6, 2025 18:49
@TomasVotruba TomasVotruba changed the title Bump [dx] show type coverage only if full paths are analysed, to avoid spamming output Jan 6, 2025
@TomasVotruba
Copy link
Owner Author

cc @staabm I'm curious about your opinion... is there a better way to do this? :)

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
@TomasVotruba TomasVotruba force-pushed the tv-avoid-spamming-for-subset branch from e01e5d6 to 12db35d Compare January 6, 2025 18:51
@TomasVotruba TomasVotruba self-assigned this Jan 6, 2025
@staabm
Copy link
Contributor

staabm commented Jan 6, 2025

Does your workarround achieve the same thing as

https://github.com/shipmonk-rnd/dead-code-detector/blob/bbc92af68e4c777319285a0ef256730bef461599/src/Rule/DeadCodeRule.php#L143 ?

And is the bug your comment explains the same as phpstan/phpstan#12328 ?

@TomasVotruba
Copy link
Owner Author

It's first time I see the method. What does it do? (I'm on a phone)

I don't understand the issue, but it could be related.
Basically some rules and collectors should not run, if not run on a whole codebase.
It should also solve same case in unused-public package

@TomasVotruba
Copy link
Owner Author

TomasVotruba commented Jan 6, 2025

Checking the docs https://apiref.phpstan.org/2.0.x/source-src.Node.CollectedDataNode.html#55, it's not reliable.
https://github.com/phpstan/phpstan-src/blob/2f712479fe1aa86f618a49fe4f36a3531230484b/src/File/FileFinder.php#L44

We often pass a couple directories. In that case it should be skipped too, not just in case of files.

Also, this must be available not just in collector but also in rule itself.

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
@TomasVotruba TomasVotruba merged commit 961f780 into main Jan 7, 2025
5 checks passed
@TomasVotruba TomasVotruba deleted the tv-avoid-spamming-for-subset branch January 7, 2025 00:09
@TomasVotruba
Copy link
Owner Author

Let's test this in the wild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants