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

Update webdevstudios/php-coding-standards to ~1.3.0 #580

Merged
merged 2 commits into from
Feb 19, 2021

Conversation

richaber
Copy link
Contributor

No ticket #.

DESCRIPTION

Updates WDS PHP coding standards to ~1.3.0
This will alleviate the Short array syntax is not allowed "error" when running PHPCS (ref WebDevStudios/php-coding-standards#40).

OTHER

  • Is this issue accessible? (Section 508/WCAG 2.0AA)
  • [x ] Does this issue pass all the linting? (PHPCS, ESLint, SassLint)
  • Does this pass CBT?

STEPS TO VERIFY

Prior to this PR, using WDS PHP coding standards to ~1.2.1,

  1. Add an array to some PHP code using short array syntax
  2. Run composer install
  3. Run composer run lint:php
    Observe PHPCS Short array syntax is not allowed errors (example):
09:02 $ composer run lint:php
> composer run lint:php-compat && composer run lint:phpcs
> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs -p . --standard=PHPCompatibility --extensions=php --runtime-set testVersion 7.4 --ignore='.github/*,vendor/*' --warning-severity=8 -d memory_limit=-1
..................................... 37 / 37 (100%)


Time: 7.25 secs; Memory: 12MB

> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=-1 --standard=./.phpcs.xml.dist --extensions=php -n --colors **/*.php

FILE: ...ites/wd_s/app/public/wp-content/themes/wd_s/inc/scripts.php
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
  41 | ERROR | [x] Short array syntax is not allowed
  47 | ERROR | [x] Short array syntax is not allowed
  54 | ERROR | [x] Short array syntax is not allowed
  77 | ERROR | [x] Short array syntax is not allowed
  85 | ERROR | [x] Short array syntax is not allowed
 112 | ERROR | [x] Short array syntax is not allowed
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 1.81 secs; Memory: 14MB

Script @php ./vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=-1 --standard=./.phpcs.xml.dist --extensions=php -n --colors **/*.php handling the lint:phpcs event returned with error code 2
Script composer run lint:php-compat && composer run lint:phpcs handling the lint:php event returned with error code 2

After this PR, using WDS PHP coding standards to ~1.3.0,

  1. Add an array to some PHP code using short array syntax
  2. Run composer install
  3. Run composer run lint:php
    Observe PHPCS Short array syntax is not allowed errors are gone (example):
09:08 $ composer run lint:php
> composer run lint:php-compat && composer run lint:phpcs
> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs -p . --standard=PHPCompatibility --extensions=php --runtime-set testVersion 7.4 --ignore='.github/*,vendor/*' --warning-severity=8 -d memory_limit=-1
..................................... 37 / 37 (100%)


Time: 3.16 secs; Memory: 12MB

> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=-1 --standard=./.phpcs.xml.dist --extensions=php -n --colors **/*.php

DOCUMENTATION

I do not believe the documentation will need to be updated.

@coreymcollins coreymcollins merged commit f187674 into main Feb 19, 2021
@coreymcollins coreymcollins deleted the feature/update-wds-php-coding-standards branch February 19, 2021 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants