Can PHPCBF autofix line length errors? #3221
-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 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. |
Beta Was this translation helpful? Give feedback.
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.