rtCamp / github-actions-library

Collection of Github Actions useful for WordPress Deployments
92 stars 8 forks source link

Update vip-go-ci sniffs #26

Open mrrobot47 opened 5 years ago

mrrobot47 commented 5 years ago

TODOs from the discussion here.

  1. Install all the sniffs. WordPress-VIP-Go and `WordPress
  2. Make sniffer respect the project ruleset.
mbtamuli commented 5 years ago

@mbtamuli Can we install all sniffs? and if it can respect project ruleset file it will be great. https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file

@PatelUtkarsh Do you have a list of all the sniffs required?

PatelUtkarsh commented 5 years ago

@mbtamuli I think following are fine:

PEAR, Zend, PSR2, MySource, Squiz, PSR1, PSR12, PHPCompatibilityWP, WordPressVIPMinimum, WordPress-VIP-Go, PHPCompatibility, PHPCompatibilityParagonieRandomCompat, PHPCompatibilityParagonieSodiumCompat, WordPress-VIP, WordPress, WordPress-Extra, WordPress-Docs, WordPress-Core and WPThemeReview

Those are installed in my local using following composer package:

        "wp-cli/wp-cli-bundle": "^2.0",
        "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
        "wp-coding-standards/wpcs": "1.2.1",
        "automattic/vipwpcs": "^0.4.0",
        "phpcompatibility/php-compatibility": "^9.1",
        "phpcompatibility/phpcompatibility-wp": "^2.0",
        "wptrt/wpthemereview": "^0.1.0"
mrrobot47 commented 5 years ago

Currently installed standards are the following:

The installed coding standards are 
MySource
PEAR
PHPCompatibility
PHPCompatibilityParagonieRandomCompat
PHPCompatibilityParagonieSodiumCompat
PHPCompatibilityWP
PSR1
PSR12
PSR2
Squiz
WordPress
WordPress-Core
WordPress-Docs
WordPress-Extra
WordPress-VIP
WordPress-VIP-Go
WordPressVIPMinimum
Zend

Only, WPThemeReview is not present from the list of standards mentioned by @PatelUtkarsh.

Which standards should run by default in inspections of:

  1. A VIP project
  2. Non-VIP Project
rahulsprajapati commented 5 years ago
  1. A VIP project

    • VIP Go - WordPress-VIP-Go PHPCompatibility ( > 7.2 ), ( Set severity = 1 )
    • VIP Classic - WordPressVIPMinimum PHPCompatibility ( > 7.2 ), ( Set severity = 1 )
  2. Non-VIP Project

    • This need to be decided, we can use ( WordPress-Core, WordPress-Docs )

I think we should keep this in some repo ( maybe in this repo only ) as phpcs.xml files. And use that files as default. And we can update. Like: phpcs/vip/go/phpcs.xml phpcs/vip/classic/phpcs.xml phpcs/phpcs.xml