Can PHPCBF autofix line length errors? #3221
Answered
by
gsherwood
puka-tchou
asked this question in
Q&A
|
Hey, I'm progressively integrating PHPCS as a part of our quality testing and we are getting a lot of line length errors. Can PHPCBF fix these issues and if not is this doable? This would really help us to correct our code much faster. |
Answered by
gsherwood
Feb 17, 2021
Replies: 1 comment 3 replies
|
No, PHPCBF cannot auto-fix line length as it doesn't have rules for where to break a statement up in a way that makes sense to a developer. I don't think this is something that PHPCBF will ever do as it's really something that a developer should take a look at and see if there are other ways to shorten the line. Simply cutting it at the break-point isn't really the point of the line length sniff. If you don't want line length checked, you can create a custom ruleset.xml file and just remove that check. |
3 replies
Answer selected by
puka-tchou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, PHPCBF cannot auto-fix line length as it doesn't have rules for where to break a statement up in a way that makes sense to a developer. I don't think this is something that PHPCBF will ever do as it's really something that a developer should take a look at and see if there are other ways to shorten the line. Simply cutting it at the break-point isn't really the point of the line length sniff.
If you don't want line length checked, you can create a custom ruleset.xml file and just remove that check.