mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
[pylint
]: bad-string-format-type (#2572)
This commit is contained in:
parent
417fe4355f
commit
48daa0f0ca
12 changed files with 1239 additions and 2 deletions
20
docs/rules/bad-string-format-type.md
Normal file
20
docs/rules/bad-string-format-type.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# bad-string-format-type (PLE1307)
|
||||
|
||||
Derived from the **Pylint** linter.
|
||||
|
||||
### What it does
|
||||
Checks for mismatched argument types in "old-style" format strings.
|
||||
|
||||
### Why is this bad?
|
||||
The format string is not checked at compile time, so it is easy to
|
||||
introduce bugs by mistyping the format string.
|
||||
|
||||
### Example
|
||||
```python
|
||||
print("%d" % "1")
|
||||
```
|
||||
|
||||
Use instead:
|
||||
```python
|
||||
print("%d" % 1)
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue