<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Regarding exceptions, I was taught that function signatures in header<br>
files are an exception too. I don't mind either way, but if the rules<br>
disagree with the current practice, we should make that explicit.<br></blockquote><div><br></div><div>This makes sense, but can linters be taught the difference between source and header files? It would be nice to enforce the hard limit via commit hook.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Actually, I can't recall ever hearing about a soft limit. Though, I like<br>
the idea. I tried to formalize something like that once with the notion<br>
of a "visible width" during a [coreboot] discussion. Quoting myself here<br>
in case somebody is interested:<br>
<br>
> [...] I see three<br>
> major cases that people care about:<br>
> <br>
>  1. Function signatures,<br>
>  2. Code lines and<br>
>  3. Code lines containing string literals[1].<br>
> <br>
> Let's assume 72 chars of visible width (line length minus the inden-<br>
> tation) is enough for code lines. If we say two additional indentation<br>
> levels are always reasonable (a third might be too, here and there) we<br>
> would be at 96 chars.<br>
> <br>
> So I would compromise as follows:<br>
> <br>
>   o Set a hard limit around 100 chars (96 would be a nice number).<br>
>   o If a line doesn't contain a string literal, recommend a<br>
>     visible width <= 72 chars.<br>
> <br>
> Nico<br>
> <br>
> [1] I think we should treat the latter two separately because you can<br>
>     easily argue that lines with a string literal might get too long but<br>
>     if you apply the same rules to regular code, you'll get all the<br>
>     crappy stuff (too many levels of indentation, unnecessary long, less<br>
>     distinctive identifiers etc.).<br>
<br>
Full message here[2]. That would only apply to the bulk of the code and<br>
comments. For me, carefully hand-formatted passages (like tables) are<br>
always an exception.<br>
<br>
Nico<br>
<br>
[2] <a href="https://mail.coreboot.org/pipermail/coreboot/2018-May/086834.html" rel="noreferrer" target="_blank">https://mail.coreboot.org/pipermail/coreboot/2018-May/086834.html</a><br>
</blockquote></div></div>