-
Notifications
You must be signed in to change notification settings - Fork 40
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
PHPCSUtils: Add dependency #474
Comments
I've prepared the branch with the necessary changes for this, but am a little hesitant to pull it as of yet. PHPCSUtils is at this moment at I intend to tag Having said that, this means that if the PR adding PHPCSUtils would be pulled & merged now, the next release of VIPCS would have to wait to be tagged until PHPCSUtils Seeing that there are 19 closed issues/PRs in the VariableAnalysis will also use PHPCSUtils as of their next major What is the current release timeline for VIPCS 2.2.0 ? And with the above in mind, should PHPCSUtils be deferred to VIPCS 2.3.0 ? |
That makes sense then. There's no hard release date for 2.2.0 (though once we get started on the sniff reviews, I'd love to have a 4-6 week cadence), so if there are bug fixes and other improvements that can be made without needing PHPCSUtils, then we can defer adding that until 2.3.0. That said, what would be the impact on using 1.0.0-alpha3? Could it be added, and you only improve sniffs with the Utils bits you think are most stable? At worst, some unstable bits are used, and the next release of VIPCS switches to the next version of PHPCSUtils and adjusts to account for whatever bits changed. |
It's not about anything what's currently in PHPCSUtils being unstable. I'm pretty confident about what's in there already. The issue is that end-users of VIPCS would also need to set their |
Can be closed once #734 is merged. |
What problem would the enhancement address for VIP?
Much of the logic in our sniffs does not account for certain code styles, more modern PHP syntax, and misses other edge cases related to whitespace etc.
Rather than having to spend the time working out all of the edge cases of unusually formatted code, writing unit tests, and
Describe the solution you'd like
PHPCSUtils is a set of utilities to aid developers of sniffs for PHP_CodeSniffer.
This package offers the following features [taken from the above linked page]:
Use the latest version of PHP_CodeSniffer native utility functions.
Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard.
Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 2.6.0 and up.
A number of abstract sniff classes which your sniffs can extend.
These classes take some of the heavy lifting away for a number of frequently occurring sniff types.
A collection of static properties for often used token groups.
Collections of related tokens as often used and needed for sniffs.
These are additional "token groups" to compliment the ones available through the PHPCS native PHP_CodeSniffer\Util\Tokens class.
An ever growing number of utility functions for use with PHP_CodeSniffer.
Whether you need to split an array into the individual items, are trying to determine which variables are being assigned to in a list() or are figuring out whether a function has a DocBlock, PHPCSUtils got you covered!
Includes improved versions of the PHPCS native utility functions and plenty new utility functions.
These functions are, of course, compatible with PHPCS 2.6.0 up to PHPCS master.
Test utilities
An abstract UtilityMethodTestCase class to allow for testing your own utility methods written for PHP_CodeSniffer with ease.
Compatible with both PHPCS 2.x as well as 3.x. Supports PHPUnit 4.x up to 8.x.
Backward compatibility layer
A PHPCS23Utils standard which allows sniffs to work in both PHPCS 2.x and 3.x, as well as a number of helper functions for external standards which still want to support both PHP_CodeSniffer 2.x as well as 3.x.
Fully documented
To see detailed information about all available abstract sniffs, utility functions and PHPCS helper functions, have a read through the extensive documentation.
Additional context
This Issue is to summarise what PHPCSUtils is, and to be the point of reference for the PR that adds the dependencies.
Further Issues / PRs will be needed for actually swapping in the utility functions.
The text was updated successfully, but these errors were encountered: