xZise / flake8-string-format

Check that indexed parameters are used in strings
MIT License
20 stars 5 forks source link

string used with comparisons such as == and in #8

Open jayvdb opened 9 years ago

jayvdb commented 9 years ago

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.

jayvdb commented 8 years ago

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.