aganm
aganm

Reputation: 1369

Does maximum line length apply only to source code? (C, linux, clang-format)

The linux git repo has a .clang-format file with maximum line length of 80 characters.

Yet, this header file has lines longer than 90 characters.

When I use clang-format, it will break such long lines in multiple lines in both headers and source.

Does the rule of 80 characters only apply to source files and not header files? Is this file alone being excluded from clang-format? Did I miss something?

Upvotes: 0

Views: 581

Answers (1)

Karthik Sriram
Karthik Sriram

Reputation: 124

Linus changed the max character length to 100 last year May. It's still preferable to stay under 80, but the style guide allows it be >80 for certain cases. Here's the patch.

Upvotes: 1

Related Questions