An open API service indexing awesome lists of open source software.

https://github.com/webgriffe/hyva-coding-standard-dist

Hyva Coding Standard distribution for Webgriffe projects (no dep conflicts)
https://github.com/webgriffe/hyva-coding-standard-dist

Last synced: 5 days ago
JSON representation

Hyva Coding Standard distribution for Webgriffe projects (no dep conflicts)

Awesome Lists containing this project

README

          

# webgriffe/hyva-coding-standard-dist

Hyvä Themes PHP_CodeSniffer coding standard distribution for Webgriffe projects.

Repackages [hyva-themes/hyva-coding-standard](https://github.com/hyva-themes/hyva-coding-standard)
with minimal dependencies to avoid version conflicts when installed alongside Magento.

## Installation

```sh
composer require --dev webgriffe/hyva-coding-standard-dist
```

Composer will prompt you to allow the `dealerdirect/phpcodesniffer-composer-installer` plugin
(one-time), or add it upfront to your project's `composer.json`:

```json
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
```

The `dealerdirect` plugin automatically registers the `HyvaThemes` and `Magento2` standards
in phpcs on every `composer install` / `composer update`.

## Usage

```sh
vendor/bin/phpcs --standard=HyvaThemes app/code/path/to/check
```

## Known issue: hardcoded `installed_paths` in post-install-cmd

If your project's `composer.json` already has a `post-install-cmd` / `post-update-cmd` script
that calls `phpcs --config-set installed_paths ...` directly, it runs **after** the `dealerdirect`
plugin and overwrites the registered paths. Fix: append `vendor/webgriffe/hyva-coding-standard-dist`
to that list:

```json
"post-install-cmd": [
"[ -f vendor/bin/phpcs ] && vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard,...,vendor/webgriffe/hyva-coding-standard-dist || true"
]
```