github-actions-library
github-actions-library copied to clipboard
Update vip-go-ci sniffs
TODOs from the discussion here.
- Install all the sniffs. WordPress-VIP-Go and ``WordPress`
- Make sniffer respect the project ruleset.
@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 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"
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:
- A VIP project
- Non-VIP Project
-
A VIP project
- VIP Go -
WordPress-VIP-Go
PHPCompatibility ( > 7.2 ), ( Setseverity
= 1 ) - VIP Classic -
WordPressVIPMinimum
PHPCompatibility ( > 7.2 ), ( Setseverity
= 1 )
- VIP Go -
-
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