-
Notifications
You must be signed in to change notification settings - Fork 395
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
PHPCS is invoked inconsistently between blt validate and git pre-commit hooks #3366
Comments
@grasmash is there history on why this is this way that we should know about here? |
Don't know for sure if this is the cause, but the commit to update to PHPCS 3.0 (from #3132) removed the bootstrap file that BLT was previously using. Bootstrap file's purpose:
Bootstrap file was removed because it's incompatible with 3.0, and in my testing, I did not see a functionality regression. |
@wu-edward well that could certainly explain why / how we have so much yucky code in BLT 10... |
I did look into writing a new bootstrap file, but implementation would be completely different, and any examples I could find were for the the 2.x version of PHPCS. |
All of the failures in the OP come from the following directories:
The contents of those directories mostly come from upstream products (e.g. ACSF) that have code style problems that BLT can't control. So in fact I think it's desirable (at least for now) that we don't sniff those. Assuming we agree on that, then |
Ugh... so I've looked through how the bootstrap file is used in PHPCS 3 and it's radically less friendly than in PHPCS 2. We could probably make it work but it would be inelegant. I think a better solution for this issue in the short term is to just exclude ACSF-provided files from sniffing by adding the following to phpcs.xml.dist:
It doesn't fix the root issue here but at least fixes the symptom so fewer people run into this as a regression. The sooner we get that in the sooner we can release the next 9.x / 9.2.x. @malikkotob and @mikemadison13 thoughts? |
I added pcphs ignored for specific analysis in the factory hooks. The thing that is still unclear to me why validate ignored the issue and the commit hook doesn't. We may have to do as you suggest though to be consistent... |
My system information:
Output of
blt doctor
:When I run this command:
I get the following output:
And I expected this to happen:
PHPCS to flag the same issues it is flagging as part of its execution during the git pre-commit hook:
The text was updated successfully, but these errors were encountered: