Skip to content
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

Ignore composer-plugin-api (and exclude packages) from reported packages #217

Closed
icanhazstring opened this issue Oct 4, 2021 · 5 comments · Fixed by #222
Closed

Ignore composer-plugin-api (and exclude packages) from reported packages #217

icanhazstring opened this issue Oct 4, 2021 · 5 comments · Fixed by #222
Labels

Comments

@icanhazstring
Copy link
Member

icanhazstring commented Oct 4, 2021

Describe the bug

With latest rebuild for ersion 0.8 there a still some implementations missing: like exclude packages. (with the --excludePackageoption)

If you are using composer-unused for any composer plugin (or even composer-unused itself), the composer-plugin-api package is required but does not actually ship any code. This should be also added to excluded Packages.

These types of packages should be removed here:
https://github.com/composer-unused/composer-unused/blob/main/src/Console/Command/UnusedCommand.php#L101

@icanhazstring
Copy link
Member Author

± |main {6} ✓| → ./build/composer-unused.phar --excludeDir=data
Plugin command unused (Icanhazstring\Composer\Unused\Command\UnusedCommand) would override a Composer command and has been skipped

Loading packages
----------------

 6/6 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ! [NOTE] Found 5 package(s) to be checked.                                                                             

Scanning files from basedir /Users/andreas.froemer/Projects/composer-unused/composer-unused
-------------------------------------------------------------------------------------------

 35/35 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

Results
-------

Found 5 used, 0 unused and 1 ignored packages

 Used packages
 ✓ php
 ✓ composer-unused/symbol-parser
 ✓ nikic/php-parser
 ✓ psr/container
 ✓ psr/log

 Unused packages

 Ignored packages
 ○ composer-plugin-api (Unable to locate package) <- this should not be listed

@icanhazstring icanhazstring changed the title Ignore composer-plugin-api from reported packages Ignore composer-plugin-api (and exclude packages) from reported packages Oct 4, 2021
@verenaroe
Copy link
Contributor

I would add a filter here

to always exclude composer-plugin-api and merge it with existing exclusions from the --excludePackage option. I would create an array of packages which should always be excluded that can be extended in the future. What do you think?

@icanhazstring
Copy link
Member Author

Hi @verenaroe. Yes, this would be a good way. Go ahead :)
And thanks in advance 💪

@icanhazstring
Copy link
Member Author

We might also add some actual rules which are used to ignore packages.
For example:

  • PatternExclusion
  • NamedExclusion

This way we can make sure, that we can also exclude packages by pattern, e.g. *-implementation (as mentioned in #93)
and also directly named packages using the --excludePackage option.

@icanhazstring
Copy link
Member Author

@verenaroe if you need any help. Let me know.

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

Successfully merging a pull request may close this issue.

2 participants