-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
FEATURE: Detect indirect usage of direct requirements #235
Comments
I would argue that even the current implementation is not what I'd expect. Packages that are only referenced (or required) in dependencies of mine should be marked as unused, since I don't actually use them. I know there are different opinions on how to handle such indirect dependencies. Some would like to declare them, but I'd like to keep my declared dependencies to those I actually use (otherwise you could declare the whole dependency tree as a direct dependency). So I'd be in favour of making indirect dependency checking optional. However, the problem with dependencies like |
If no symbol of your required packages are used, they are marked as unused.
On the contrary: This only works for your required packages. If any symbol of that is directly used by another of your direct dependencies. Then both should be marked as used. But I think yes, to have an option to skip indirect usage would be some option to provide. |
Hi @icanhazstring, I'm not sure will would be 100% benefit. Let's I use a library A. If I want to use the FooEvent/FooEventListener, I need to install the library B. I can be in the situation where:
With this situation
In the same way that I can do
I would have expect a way to write something like
to tell composer-unused that
|
Originally posted by @MGatner in #234
This happens if the root package will require a package that is not directly used by the root, but by another direct dependency. Those packages will currently be marked as unused while they are technically in use in an indirect way.
We need to actually also scan second level usage to mark indirect dependencies used.
Currently we only scan for provided symbols from a dependency, but we need to also scan for used symbols (like in the root package)
The text was updated successfully, but these errors were encountered: