Skip to content
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

Editorial convention: Semantic line breaks #2045

Closed
emlun opened this issue Mar 18, 2024 · 3 comments · Fixed by #2127
Closed

Editorial convention: Semantic line breaks #2045

emlun opened this issue Mar 18, 2024 · 3 comments · Fixed by #2127
Assignees
Labels
@Risk Items that are at risk for L3 type:editorial type:process

Comments

@emlun
Copy link
Member

emlun commented Mar 18, 2024

Semantic line breaks is an editorial convention that may facilitate more efficient work on the text, while making no difference to the rendered output.

Currently, the WebAuthn spec source is a mix of at least 3 styles of line breaks:

  • No line breaks: a whole paragraph of text may be a single line in the source. Example in spec
  • Hard-wrapped text: add a line break before each word that would extend past some particular column width. The column limit also varies throughout the document. Example in spec
  • Semantic line breaks: add line breaks at semantically meaningful points, such as after punctuation, before subordinate clauses, etc. Example in spec

Of the three, I find that semantic line breaks makes text easiest to work with, in several ways:

  • It typically results in a text width that's comfortable to work with in a text editor as well as in GitHub diffs and commandline Git diffs.
  • Small changes to a paragraph are easy to identify and do not "inflate" diffs:
    • With no line breaks, the entire line shows as changed unless word diff highlighting is used. GitHub diffs do usually highlight word differences, but only up to some limited line length - very long lines do not seem to get word diffs.
    • With hard-wrapped text, the whole rest of the paragraph shows as changed if the word wrapping changes. This works okay with word diff in commandline Git, but not very well in GitHub diffs.
    • With semantic line breaks, neighboring lines usually do not need to change since they are separated at semantically meaningful borders.

Proposed Change

Adopt semantic line breaks as an editorial convention for future changes:

  • Do not change existing text to use semantic line breaks.
  • When changing text that is not formatted with semantic line breaks, reformat changing lines to use semantic line breaks. Do not reformat unchanged neighboring lines to use semantic line breaks unless it's very few lines, or it otherwise helps readability, or it otherwise seems like a good idea.
  • When adding new text, use semantic line breaks.
  • Take the Semantic Line Breaks specification as a set of guidelines, not a rigid set of rules. If a contributor proposes changes that clearly do not use semantic line breaks, inform or remind them of the convention and ask them to reformat, but respect their choice of where to place line breaks and do not "bikeshed" the details. The point is to make the text easier to work with, not to enforce a style.
    • In particular, I think the recommended max line length of 80 characters is too restrictive with how much indentation and markup syntax we use. Something more like ~100 characters, or ~80 characters excluding indentation, may be more appropriate for this document. But I don't think we should set a hard limit - use good judgement of where to draw the line in each case.
  • Add a notice of this convention to CONTRIBUTING.md.

This should apply to changes made after the decision and to pull requests opened after the decision. Existing pull requests MAY be updated to the new convention, but are not required to apply this convention retroactively.

@timcappalli
Copy link
Member

+1. This has been driving me crazy.

@nicksteele
Copy link
Contributor

Should just need an update to README.md for this, thanks for pushing Emil!

@MasterKale
Copy link
Contributor

Looks good to me, thank you Emil for the thorough collection of examples!

@emlun emlun self-assigned this Apr 24, 2024
@nadalin nadalin added the @Risk Items that are at risk for L3 label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@Risk Items that are at risk for L3 type:editorial type:process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants