lint: Prohibit percent formatting on literal format strings.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-06-13 22:01:21 -07:00 committed by Tim Abbott
parent 5dc9b55c43
commit 769e198ab0
1 changed files with 8 additions and 0 deletions

View File

@ -116,3 +116,11 @@ rules:
...
severity: ERROR
message: "Guard mutable default with read-only type (Sequence, Mapping, AbstractSet)"
- id: percent-formatting
languages: [python]
pattern-either:
- pattern: '"..." % ...'
- pattern: '("...") % ...'
severity: ERROR
message: "Prefer f-strings or .format for string formatting"