Explorar el Código

Added cli commands for PHP_CodeSniffer

pniel-cohen hace 2 años
padre
commit
2b51e0700c
Se han modificado 4 ficheros con 9 adiciones y 0 borrados
  1. 3 0
      README.md
  2. 2 0
      compose/bin/phpcbf
  3. 2 0
      compose/bin/phpcs
  4. 2 0
      compose/bin/phpcs-json-report

+ 3 - 0
README.md

@@ -250,6 +250,9 @@ It is recommended to keep your root docker config files in one repository, and y
 - `bin/n98-magerun2`: Access the [n98-magerun2](https://github.com/netz98/n98-magerun2) CLI. Ex: `bin/n98-magerun2 dev:console`
 - `bin/node`: Run the node binary. Ex. `bin/node --version`
 - `bin/npm`: Run the npm binary. Ex. `bin/npm install`
+- `bin/phpcbf`: Auto-fix PHP_CodeSniffer errors with Magento2 options. Ex. `bin/phpcbf <path-to-extension>`
+- `bin/phpcs`: Run PHP_CodeSniffer with Magento2 options. Ex. `bin/phpcs <path-to-extension>`
+- `bin/phpcs-json-report`: Run PHP_CodeSniffer with Magento2 options and save to `report.json` file. Ex. `bin/phpcs-json-report <path-to-extension>`
 - `bin/pwa-studio`: (BETA) Start the PWA Studio server. Note that Chrome will throw SSL cert errors and not allow you to view the site, but Firefox will.
 - `bin/redis`: Run a command from the redis container. Ex. `bin/redis redis-cli monitor`
 - `bin/remove`: Remove all containers.

+ 2 - 0
compose/bin/phpcbf

@@ -0,0 +1,2 @@
+#!/bin/bash
+bin/clinotty vendor/bin/phpcbf --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations "$@"

+ 2 - 0
compose/bin/phpcs

@@ -0,0 +1,2 @@
+#!/bin/bash
+bin/clinotty vendor/bin/phpcs --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations "$@"

+ 2 - 0
compose/bin/phpcs-json-report

@@ -0,0 +1,2 @@
+#!/bin/bash
+bin/clinotty vendor/bin/phpcs --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations --report=json "$@" > report.json