-
Notifications
You must be signed in to change notification settings - Fork 21
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
Exclude computer generated code (e.g. minified JS/CSS) from PHPCS #63
Comments
I just want to mention that the Content Hub module is also running into this issue (minified css and js files from package build which phpcs is failing). I'm going to submit a separate feature request to allow warnings to still pass phpcs. |
Since ORCA's purpose is to enforce company standards, allowing unlimited configurability is undesirable. Implementers could just suppress legitimate errors they didn't want to fix. Some limited configurability might be appropriate, though. Of course, they can already choose between a predefined set of PHPCS standards of varying strictness. If it seems appropriate after further consideration, we could also do something like letting them choose between failing on warnings or errors only. But I would assume that any specific sniffs that were problematic for one implementer would be (at least potentially) for all. So I would like to fix those centrally--either in ORCA, Acquia Coding Standards, or further upstream. Would you like to create issues for specific problems we can solve across the board? The compiled files problem, in particular, seems like a slam dunk. If you still feel a need for configurability as such, we can continue discussion of that here. |
IMO, this is the heart of what this ticket is about. Perhaps just retitling this issue would be more efficient than creating new tickets. Proposed title: Exclude computer generated code (e.g. minified JS/CSS) from PHPCS |
Sounds good to me, @gabesullice! May I have a link to a failed build so I can identify the offending sniff? |
Here's a link to the same issue in our build... minified css in this one: https://travis-ci.com/github/acquia/acquia_contenthub/jobs/311770019 |
In https://github.com/acquia/acquia_migrate we're using webpack to build minified CSS and JS files. These files often have (practically) unfixable PHP_CodeSniffer violations. Since these files are computer-generated, I would like a way to exclude them. They all live in a
dist
directory so it'd be okay to exclude that directory completely, but it'd also be fine if we had to exclude each generated file explicitly. I guess it doesn't necessarily have to be configurable. ORCA could hardcode thedist
directory as excluded (just like it excludesvendor
).The text was updated successfully, but these errors were encountered: