-
Notifications
You must be signed in to change notification settings - Fork 919
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
refactor: linewrapping comments to 100 width #1274
refactor: linewrapping comments to 100 width #1274
Conversation
Should we potentially add this to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👏
Also +1 for adding this to make fmt
Love this being automated! Why 80 is chosen to be the value for line length? Diff seems to have many 1 word newlines so it seems there was some formatting before that used a higher value. |
It actually dates back to punch cards I think haha but nowadays it it more about consistency and readability. Some languages recommend a maximum line length in their standards, see this short little article https://www.codereadability.com/maximum-line-length/ The comments bring up a number of nice points, like readability on laptops with split screens, accessibility concerns, etc. |
27cbcb8
to
51f6bbb
Compare
@MSevey, if the argument is about the split screen, should we then also stick to the code itself being no more than 80, not just comments like this PR and tool do? The article you sent argues about the code length AFAIS. If we agree that we should shorten our code length, then we should also do it in this PR, imo |
@Wondertan up to the team on line wrapping the code to 80. For me the difference is that the code has So for me it is less the number and more that there is something that is keeping things consistent. It just makes the code nicer to work with and you don't get PRs with huge formatting diffs because people have different formatting settings locally. |
Good point. The question on changing the code length number remains open for the team. Personally, I feel like the length of the comments should be the same as the code or just a little shorter. Like if the code is 120, the comments should be 100/120 and not 80. So the gap of 20 is acceptable, but not more than that. Otherwise it feels a bit odd to me. |
yea, I'm not tied to 80, I'm just tied to consistency :-)
|
Ok, so let's:
And we are good to go |
51f6bbb
to
d3d2904
Compare
Set it to linelength 100 (code is at 120), and added it to One thing to note: I do not agree (and assume others are with me here) that the /minimum/ line length before a break should also be 100. It makes sense in a lot of places in our docs and explanation comments to line break earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thank u
@distractedm1nd minimum shouldn't be 100 tho |
4e222ca
d3d2904
to
4e222ca
Compare
I reformatted all comments in the repository to wrap to 80 line width using https://github.com/alexkohler/cfmt.