-
Notifications
You must be signed in to change notification settings - Fork 187
Fix formatting breakage #322
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
Conversation
PHP_CodeSniffer 3.0 RC4 introduces a breaking change that removes PHPCS from the composer autoloader. This fix adds a bootstrapping step so that we can invoke the autoloader automatically.
Codecov Report
@@ Coverage Diff @@
## master #322 +/- ##
===========================================
- Coverage 84.15% 84.1% -0.05%
Complexity 811 811
===========================================
Files 59 60 +1
Lines 1717 1718 +1
===========================================
Hits 1445 1445
- Misses 272 273 +1
Continue to review full report at Codecov.
|
|
|
||
| // PHP_CodeSniffer does not define an autoloader in its composer.json, | ||
| // so we must invoke it ourselves. | ||
| require __DIR__ . "/../vendor/squizlabs/php_codesniffer/autoload.php"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't it miss to include the "regular" vendor/autoload.php now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm a bit worried we are coupling ourselves to the CodeSniffer autoloader here. So far, I only had problems with it and passing CodeSniffer a string to format while we already have an AST for the document is less than ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option is just locking to the RC3 release, which is not broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was at the time a reason why I had to depend on the unstable version, it had an important bug fix - maybe it's fixed now in the most recent RC, might be worth to try out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, just saw that I do not depend on the unstable version anymore:
"squizlabs/php_codesniffer" : "^3.0",I wonder how the breaking change got in there then, as preferStable is set?
Anyway, if it fixes it and tests pass I would prefer to lock the most recent version that works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there aren't any stable versions for 3.0 yet (2.x is the current stable version)
|
Closing in favor of #324 |
PHP_CodeSniffer 3.0 RC4 introduces a breaking change that removes PHPCS from the composer autoloader. This fix adds a bootstrapping step so that we can invoke the autoloader automatically. Tests should pass after this.
Also see
close #321