Skip to content

Switch some quotes to backticks in errors#2889

Merged
charliermarsh merged 2 commits intoastral-sh:mainfrom
andersk:backticks
Feb 14, 2023
Merged

Switch some quotes to backticks in errors#2889
charliermarsh merged 2 commits intoastral-sh:mainfrom
andersk:backticks

Conversation

@andersk
Copy link
Copy Markdown
Contributor

@andersk andersk commented Feb 14, 2023

Improves consistency with the style decision in #723, I think.

andersk and others added 2 commits February 13, 2023 22:58
@charliermarsh charliermarsh enabled auto-merge (squash) February 14, 2023 22:22
@charliermarsh charliermarsh merged commit 2e41301 into astral-sh:main Feb 14, 2023
lucach added a commit to lucach/ruff that referenced this pull request Oct 31, 2025
The parser currently uses single quotes to wrap tokens.
This is inconsistent with the rest of ruff/ty, which use backticks.

For example, see the inconsistent diagnostics produced in this simple example: https://play.ty.dev/0a9d6eab-6599-4a1d-8e40-032091f7f50f

Consistently wrapping tokens in backticks produces uniform diagnostics.
Following astral-sh#723, in astral-sh#2889 some quotes were already switched into backticks.

This is also in line with Rust's guide on diagnostics
(https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure):

> When code or an identifier must appear in a message or label, it should be surrounded with backticks
Gankra pushed a commit that referenced this pull request Oct 31, 2025
… of 'quotes' (#21163)

The parser currently uses single quotes to wrap tokens. This is
inconsistent with the rest of ruff/ty, which use backticks.

For example, see the inconsistent diagnostics produced in this simple
example: https://play.ty.dev/0a9d6eab-6599-4a1d-8e40-032091f7f50f

Consistently wrapping tokens in backticks produces uniform diagnostics.
Following the style decision of #723, in #2889 some quotes were already
switched into backticks.

This is also in line with Rust's guide on diagnostics
(https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-structure):

> When code or an identifier must appear in a message or label, it
should be surrounded with backticks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants