mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00

Previously the rule documentation referenced configuration options via full https:// URLs, which was bad for several reasons: * changing the website would mean you'd have to change all URLs * the links didn't work when building mkdocs locally * the URLs showed up in the `ruff rule` output * broken references weren't detected by our CI This commit solves all of these problems by post-processing the Markdown, recognizing sections such as: ## Options * `flake8-tidy-imports.ban-relative-imports` `cargo dev generate-all` will automatically linkify such references and panic if the referenced option doesn't exist. Note that the option can also be linked in the other Markdown sections via e.g. [`flake8-tidy-imports.ban-relative-imports`] since the post-processing code generates a CommonMark link definition. Resolves #2766.
29 lines
No EOL
610 B
Markdown
29 lines
No EOL
610 B
Markdown
# bad-quotes-inline-string (Q000)
|
|
|
|
Derived from the **flake8-quotes** linter.
|
|
|
|
Autofix is always available.
|
|
|
|
## What it does
|
|
Checks for inline strings that use single quotes or double quotes,
|
|
depending on the value of the [`flake8-quotes.inline-quotes`] option.
|
|
|
|
## Why is this bad?
|
|
Consistency is good. Use either single or double quotes for inline
|
|
strings, but be consistent.
|
|
|
|
## Options
|
|
|
|
* [`flake8-quotes.inline-quotes`]
|
|
|
|
## Example
|
|
```python
|
|
foo = 'bar'
|
|
```
|
|
|
|
Assuming `inline-quotes` is set to `double`, use instead:
|
|
```python
|
|
foo = "bar"
|
|
```
|
|
|
|
[`flake8-quotes.inline-quotes`]: ../../settings#inline-quotes |