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

Invalid package name 'ext-xxx' #217

Open
Neirda24 opened this issue Jan 13, 2025 · 2 comments
Open

Invalid package name 'ext-xxx' #217

Neirda24 opened this issue Jan 13, 2025 · 2 comments

Comments

@Neirda24
Copy link

Neirda24 commented Jan 13, 2025

Hi.

I have this issue:

Found 1 dev dependency in production code!
(those should probably be moved to "require" section in composer.json)

  • ext-mbstring
      mb_strlen
        My/File.php:10

so I tried to add the following in my config :

return $config
    // ...

    ->ignoreErrorsOnPackage('ext-mbstring', [
        ErrorType::DEV_DEPENDENCY_IN_PROD,
    ])
;

but I get the following error :

Error while loading configuration from '.../composer-dependency-analyser.php':

ShipMonk\ComposerDependencyAnalyser\Exception\InvalidConfigException in .../vendor/shipmonk/composer-dependency-analyser/src/Config/Configuration.php:613
 > Invalid package name 'ext-mbstring'

I think it would be relevant to update this regex to ~^(?:(?:[a-z0-9]([_.-]?[a-z0-9]+)*/)|ext-)[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$~

WDYT ?

@JanTvrdik
Copy link
Member

Try using ignoreErrorsOnExtensions instead.

@Neirda24
Copy link
Author

But this ignores all extensions. Why ignoring ? What would be the drawbacks of updating this regex ?

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

No branches or pull requests

2 participants