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

Simplify installation instructions #436

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ To use within your Magento 2 project you can use:
composer require --dev magento/magento-coding-standard
```

Due to security, when installed this way the Magento standard for phpcs cannot be added automatically.
You can achieve this by adding the following to your project's `composer.json`:

```json
"scripts": {
"post-install-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
],
"post-update-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
]
}
```

### Installation for development

You can install Magento Coding Standard by cloning this GitHub repo:
Expand Down Expand Up @@ -122,7 +108,7 @@ The rules from rector that are applied are set inside the config file: `rector.p
The option `--dry-run` displays errors found, but code is not automatically fixed.

To run rector for `magento` projects you need to:
- Specify the magento path and the autoload file for the magento project:
- Specify the magento path and the autoload file for the magento project:
```bash
vendor/bin/rector process MAGENTO_PATH --dry-run --autoload-file MAGENTO_AUTOLOAD_FILE
```
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"version": "35",
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2 || ^1.0",
fredden marked this conversation as resolved.
Show resolved Hide resolved
"webonyx/graphql-php": "^15.0",
"ext-simplexml": "*",
"ext-dom": "*",
Expand All @@ -35,13 +36,9 @@
"Magento2Framework\\": "Magento2Framework/"
}
},
"scripts": {
"post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility",
"post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading