Provides a composer plugin for normalizing composer.json.
Provides a composer plugin for normalizing composer.json.
This project provides a composer plugin for normalizing composer.json.
When it comes to formatting composer.json, you have the following options:
ergebnis/composer-normalizeergebnis/composer-normalize normalizes composer.json, so you don't have to.
:bulb: If you want to find out more, take a look at the examples and read this blog post.
Run
composer require --dev ergebnis/composer-normalizeto install ergebnis/composer-normalize as a composer plugin.
Run
composer config allow-plugins.ergebnis/composer-normalize trueto allow ergebnis/composer-normalize to run as a composer plugin.
:bulb: The allow-plugins has been added to composer/composer to add an extra layer of security.
For reference, see
Head over to http://github.com/ergebnis/composer-normalize/releases/latest and download the latest composer-normalize.phar.
Run
chmod +x composer-normalize.pharto make the downloaded composer-normalize.phar executable.
Run
phive install ergebnis/composer-normalizeto install ergebnis/composer-normalize with PHIVE.
Run
composer normalizeto normalize composer.json in the working directory.
Run
./composer-normalize.pharto normalize composer.json in the working directory.
Run
./tools/composer-normalizeto normalize composer.json in the working directory.
The NormalizeCommand provided by the NormalizePlugin within this package will
composer.json existscomposer.lock exists, and if so, whether it is up to date (unless the --no-check-lock option is used)Ergebnis\Json\Normalizer\Vendor\Composer\ComposerJsonNormalizer to normalize the content of composer.json--indent-size and --indent-style options)composer.json back to the filecomposer.lock if it exists and if an update is necessaryfile: Path to composer.json file (optional, defaults to composer.json in working directory)--diff: Show the results of normalizing--dry-run: Show the results of normalizing, but do not modify any files--indent-size: Indent size (an integer greater than 0); should be used with the --indent-style option--indent-style: Indent style (one of "space", "tab"); should be used with the --indent-size option--no-check-lock: Do not check if lock file is up to date--no-update-lock: Do not update lock file if it existsAs an alternative to specifying the --indent-size and --indent-style options, you can also use composer extra to configure these options in composer.json:
{
"extra": {
"composer-normalize": {
"indent-size": 2,
"indent-style": "space"
}
}
}:bulb: The configuration provided in composer extra always overrides the configuration provided via command line options.
If you want to run this in continuous integration services, use the --dry-run option.
composer normalize --dry-runIn case composer.json is not normalized (or composer.lock is not up-to-date), the command will
fail with an exit code of 1 and show a diff.
pestphp/pestRunning
composer normalizeagainst https://github.com/pestphp/pest/blob/v0.3.19/composer.json yields the following diff:
…The maintainers of this project record notable changes to this project in a changelog.
The maintainers of this project suggest following the contribution guide.
The maintainers of this project ask contributors to follow the code of conduct.
The maintainers of this project provide limited support.
You can support the maintenance of this project by sponsoring @ergebnis.
This project currently supports the following PHP versions:
The maintainers of this project add support for a PHP version following its initial release and may drop support for a PHP version when it has reached its end of life.
This project has a security policy.
This project uses the MIT license.
Follow @localheinz and @ergebnis on Twitter.
No open issues yet, or sync has not completed.