Skip to content

Markdown backtick #12337

Open
Feature
@roberth

Description

We're living in the age of the markdown backtick. Let's embrace it in Nix.

Proposal

Change all '%s' and '%1%' to `%s` and `%1%`

Effects

  • (+) Clear, visually unambiguous stderr output
  • (+) Renders into inline code spans when pasted into a markdown system such as GitHub, Discourse, etc
  • (-) Slightly more typing when discussing the C++ code in markdown
    Try with ``"`%s`"``
    Use a backtick (`` ` ``)
    renders to
    Try with "`%s`"
    Use a backtick (`)

Background

Nix uses ' apostrophes to demarcate the start and end of code, identifiers, user input, etc, in error messages.
This is occasionally confusing:

  • color information is not always available, including after copy/paste (i.e. when users need help)
  • adds visual noise
  • can be confused for the same ' that is allowed in identifiers, moderately obscuring the difference between 'mapAttrs' and 'mapAttrs''

Meanwhile, I have observed that over the past decade or so:

  • ` has been largely phased out from bash scripts in favor of $( )
  • markdown has won
  • the markdown ` is starting to make its way into stderr

If we were to switch from 'foo' to `foo` in error messages, this will avoid any confusing with the ' used in the language, and it will even render nicely when pasted into markdown-based systems.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnostics

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions