Skip to contentSkip to conversation

Thoughts on code line length

DISCUSSION Tom Rini 2 participants 2 messages Jun 1, 2020 – Jun 2, 2020

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

Hey all,

As I see tech sites are noting that Linus has changed the kernel's code style to no longer be so strict about 80 character line width, I figured I should say something here given how much we follow the Linux kernel anyhow.

Given that we've long told people to ignore checkpatch for dts files, and to not split error messages anyhow, and that it's more about "does the code read well", I think this is a good change that we'll pick up with our next re-sync of checkpatch.pl. I figured over the weekend I would grab Simon's checkpatch series today, but I'll wait a day or two and sync it to v5.7 release before grabbing.

I think this is a good change overall given the amount of times I've had to reduce readability slightly (and use odd variable names) to not exceed 80 characters on a line by just a few.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200601/d9397958/attachment.sig>
#1 lore raw

Hi Tom,

??? Didn't check the update for checkpatch.pl, but my point for code line

length is:

??? Warning is necessary for 80 characters exceed, so author and reviewer

can notice it, but it's case by case, if this is reasonable, it's OK to exceed 80

characters for better readability.

Thanks,

- Kever

Quoted 18 lines · Tom Rini

Hey all,

As I see tech sites are noting that Linus has changed the kernel's code style to no longer be so strict about 80 character line width, I figured I should say something here given how much we follow the Linux kernel anyhow.

Given that we've long told people to ignore checkpatch for dts files, and to not split error messages anyhow, and that it's more about "does the code read well", I think this is a good change that we'll pick up with our next re-sync of checkpatch.pl. I figured over the weekend I would grab Simon's checkpatch series today, but I'll wait a day or two and sync it to v5.7 release before grabbing.

I think this is a good change overall given the amount of times I've had to reduce readability slightly (and use odd variable names) to not exceed 80 characters on a line by just a few.