github-actions-library icon indicating copy to clipboard operation
github-actions-library copied to clipboard

Update vip-go-ci sniffs

Open mrrobot47 opened this issue 5 years ago • 4 comments

TODOs from the discussion here.

  1. Install all the sniffs. WordPress-VIP-Go and ``WordPress`
  2. Make sniffer respect the project ruleset.

mrrobot47 avatar Mar 05 '19 12:03 mrrobot47

@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?

mbtamuli avatar Mar 13 '19 09:03 mbtamuli

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

PatelUtkarsh avatar Mar 13 '19 14:03 PatelUtkarsh

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

mrrobot47 avatar Mar 14 '19 11:03 mrrobot47

  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

rahulsprajapati avatar Mar 14 '19 11:03 rahulsprajapati