Skip to content

webgriffe/hyva-coding-standard-dist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webgriffe/hyva-coding-standard-dist

Hyvä Themes PHP_CodeSniffer coding standard distribution for Webgriffe projects.

Repackages hyva-themes/hyva-coding-standard with minimal dependencies to avoid version conflicts when installed alongside Magento.

Installation

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:

"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

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:

"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"
]

About

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

Resources

License

OSL-3.0, Unknown licenses found

Licenses found

OSL-3.0
LICENSE.txt
Unknown
COPYING.txt

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors