Skip to content

meta: Are the limits on line length still necessary? #14176

@refack

Description

@refack
  1. 50 chars for commit title
  2. 72 chars for commit message
  3. 80 chars for code line

I wanted to start a discussion on why we're still enforcing them? Is it possible to extend the limits?
Especially the 80 char per code line. There are style guides that extend the limit to 120 chars, or make an exception for function calls with many arguments, and string literals.
I'm assuming originally it came from narrow terminal windows, and that it's been kept popular under the assumption that one line of code should not do too much. But sometimes it leads to very cumbersome constructs:
a random example taken from ./configure (that is actually a file that is not auto-linted.)

parser.add_option('--with-mips-arch-variant',
    action='store',
    dest='mips_arch_variant',
    default='r2',
    choices=valid_mips_arch,
    help='MIPS arch variant ({0}) [default: %default]'.format(
        ', '.join(valid_mips_arch)))

while lines that do multiple operations are considered ok

sys.exit(subprocess.call(gyp_args))

Another example is documentation files, where we don't auto-lint so it's easy to find examples where it was not upheld. Also, AFAIK most editors can soft-wrap lines while files are anyway rendered to something prettier.

Ref: #8327

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussIssues opened for discussions and feedbacks.metaIssues and PRs related to the general management of the project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions