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
[3.0] Introduce Sapi Class #8053
Conversation
Move some logic from both Config and Utils that fit better here. This should be considered very low level and should handle operating with the code in a very error safe way. Additionally, fixed some warnings from static analysis.
/** | ||
* Technically we could simplify this down using PHP_OS_FAMILY, | ||
* but to ensure backwards compatibility, we won't yet. | ||
*/ | ||
foreach ($oses as $os) { |
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.
multiline comments start with /*
; phpdoc starts with /**
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 were a bunch of things in this PR that made PHP-CS-Fixer sad. Apparently the GitHub action didn't catch them for some reason. I push a commit to fix them all. However, we clearly need to fix something in the GitHub action so that it flags these problems like it is supposed to.
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.
And I have a habit of not checking php-cs-fixer before sending. But I don't see any logic in our github actions that runs cs fixer. Just a linter
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 problem is that the linter should have flagged the formatting issues and therefore failed the check. It didn't do that.
I don't think most things are being checked properly by it
It went through with no errors.. But the checked sign off generated errors and passed through. |
Hm. Those 'bad object' errors look like Git errors. If so, that's not good at all. But I don't know where they would even be coming from; it's not from our own repository, or else we'd be seeing them ourselves constantly. |
I've dug into it. I can fix the errors, but it doesn't fix the issue well. The commit errors may be fixable. But the cs-fixer isn't. It needs to produce no output when things are ok and produce output when errors exist. I don't see a way to do that. If we can do that, I think we can fix the action. I'm looking at https://github.com/squizlabs/PHP_CodeSniffer as a replacement. A Github Action exists that does line comments. So that would be awesome. I've been playing around with creating some custom rules to offset what rules we don't have. It may take me a while to get through it and configure all the rules. I have to create custom rules for some cases where we do things differently from the standards. |
Before you do too much with PHP-CodeSniffer, I believe PHP-CS-Fixer has a --quiet option. I'm on my phone right now, so I can't check at the moment, but I suggest looking at that before doing anything else. |
I think we can fix it then. I was still testing but I got something to work for the work flow which was essentially
That was for sign-off, but we can repeat for linter. I'm not an expert in GitHub Actions @live627 seems to know more than me and may have a better idea to correct it. |
Also looks like we may be able to make it add to the comment:
Needs testing |
Actually https://github.com/squizlabs/PHP_CodeSniffer has been forked into a new project. Issue detailing it can be found here: I have been needing to update some of my projects as well just have not had the time lately. |
Yep, but the composer install is still the "old name". To be fair, working with it. There is stuff we cna't do I have found so far, but I agree with what its fixing isn't the best standards anyways. |
I think #8072 will at least solve the problem where we don't want any output from PHP-CS-Fixer unless something is wrong. |
I also suggest that we move further discussion of the GitHub actions and continuous integration to that PR, rather than here in the comments of a closed PR. |
Move some logic from both Config and Utils that fit better here. This should be considered low-level code and should handle operating with the code in a very error-safe way.
It additionally, fixed some warnings from static analysis.