flake8-string-format
flake8-string-format copied to clipboard
string used with comparisons such as == and in
Two cases in TACTIC
src/tactic/ui/panel/custom_layout_wdg.py:611:36: P103 other string does contain unindexed parameters
if not plugin or plugin == '{}':
...
src/pyasm/common/common.py:732:26: P103 other string does contain unindexed parameters
elif char in '''!@$%^&*()={}[]:"|;'\\<>?''':
If a whitelist is added, many string methods such as str.strip are known to be safe.
The only failure in vcrpy is https://github.com/kevin1024/vcrpy/blob/master/tests/unit/test_filters.py#L202
assert request.body == b'{}'
I believe unassigned strings (except docstrings of course) not used in .format calls can be skipped safely as they will not end up in a .format call.