You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see multiple errors #8203, #8025, #8283 that all have the same pattern: a Style cop wants to do an auto-correction and goes through hoops to see if the correction would create too long a line.
This feels like an anti-pattern: the cop should add the offense and provide the auto-correction with a flag saying "hey, just ignore me if this is too long". The engine has all the necessary information to ignore it or not.
But the cop should also refrain from reporting the offense in the first place, if correcting it would yield a line that's too long. So it would have to always run the auto-correction logic, even if --auto-correct was not given. To me, this seems complicated, and I would prefer to keep things as they are. Unless someone has an elegant solution to convince me. 🙂
So it would have to always run the auto-correction logic, even if --auto-correct was not given.
Correct.
To me, this seems complicated
I'm not sure it is. I would make a copy of the corrector, do a remove for all lines before and after it, apply it and check the length of the resulting lines.
I think the resulting LOC would be about what it takes just to to implement the current check on #8203
I see multiple errors #8203, #8025, #8283 that all have the same pattern: a Style cop wants to do an auto-correction and goes through hoops to see if the correction would create too long a line.
This feels like an anti-pattern: the cop should add the offense and provide the auto-correction with a flag saying "hey, just ignore me if this is too long". The engine has all the necessary information to ignore it or not.
Is it worth doing?
cc/ @Drenmi @jonas054
The text was updated successfully, but these errors were encountered: