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

Sort allow-plugins alphabetically #860

Closed
simPod opened this issue Jan 3, 2022 · 3 comments · Fixed by ergebnis/json-normalizer#723
Closed

Sort allow-plugins alphabetically #860

simPod opened this issue Jan 3, 2022 · 3 comments · Fixed by ergebnis/json-normalizer#723
Assignees
Labels

Comments

@simPod
Copy link

simPod commented Jan 3, 2022

I wonder where the new allow-plugins composer.json section could be sorted alphabetically?

@localheinz localheinz self-assigned this Jan 3, 2022
@localheinz
Copy link
Member

localheinz commented Jan 3, 2022

@simPod

I have disabled the sorting in ergebnis/json-normalizer#590 because I believe this could break the configuration for people doing something like this:

{
    "config": {
        "allow-plugins": {
            "my-organization/foo": false,
            "my-organization/*": true
        }
    }
}

When config.allow-plugins would be automatically sorted to

{
    "config": {
        "allow-plugins": {
            "my-organization/*": true,
            "my-organization/foo": false
        }
    }
}

then my-organization/foo would be allowed, while it was actually configured with the intention to be disallowed.

For reference, see https://github.com/composer/composer/blob/2.2.3/src/Composer/Plugin/PluginManager.php#L696-L700.

What do you think?

@simPod
Copy link
Author

simPod commented Jan 3, 2022

I see, did not come up with such use-case. I guess that makes sense then. Thanks!

@simPod simPod closed this as completed Jan 3, 2022
@localheinz
Copy link
Member

Thank you, @simPod!

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