ruff/docs/rules/avoid-quote-escape.md
2023-02-07 21:20:24 -05:00

23 lines
No EOL
469 B
Markdown

# avoid-quote-escape (Q003)
Derived from the **flake8-quotes** linter.
Autofix is always available.
### What it does
Checks for strings that include escaped quotes, and suggests changing
the quote style to avoid the need to escape them.
### Why is this bad?
It's preferable to avoid escaped quotes in strings. By changing the
outer quote style, you can avoid escaping inner quotes.
### Example
```python
foo = 'bar\'s'
```
Use instead:
```python
foo = "bar's"
```