Skip to content

Can PHPCBF autofix line length errors? #3221

Answered by gsherwood
puka-tchou asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@puka-tchou
Comment options

@gsherwood
Comment options

Answer selected by puka-tchou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants