flake8-string-format
flake8-string-format copied to clipboard
Check that indexed parameters are used in strings
In particular, it's very unnatural to state that something "does contain" in English, especially when highlighting a problem. You would say it "contains", and only add the extra word when...
I'm having false positives of `P102 docstring does contain unindexed parameters` because of this line: ``` {'description': '', 'extension': {}, 'time': �1N|�r�, 'tid': '\x03\xca1N|\xa9r\x99', 'serial': '\x03\xca1N|\xa9r\x99', 'user_name': '', 'size': 1042}...
I would like to forbid to call any method inside format: `f'{foo()} bzz` This convention we are trying to follow with the team, so if it's ok I can handle...
It would be nice to forbid `{0}`.format(...), `{}`.format(...) and so on calls, `str` should be used instead. If the project is maintained and feature request will be accepted, I would...
`link_regex = re.compile(r'\[\[(?P[^\]|[{}]*)(\|.*?)?\]\]')` produces `./pywikibot/__init__.py:643:25: P103 other string does contain unindexed parameters`
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...
I've been testing this on a few very large repos, and finding the occasional error In roundup (http://www.roundup-tracker.org/index.html), only the following: test/test_templating.py:350:0: P103 other string does contain unindexed parameters test/test_mailgw.py:2826:65:...
While this isnt pretty, and they might be interested in changing it as it only occurs in a few modules, it is causing false positives. ``` '''API Function: insert(search_type, data,...
The MW uses `{{…}}` for templates and `{{:Bla}}` is a valid name which shouldn't be considered a problem. One way to mitigate (at the moment) would be to use `{{...
flake8-string-format fails with Pythonn 3.14 due to [Removal of ast.Num, ast.Str, ast.Bytes, ast.NameConstant and ast.Ellipsis.](https://docs.python.org/3.14/whatsnew/changelog.html#changelog), see https://github.com/python/cpython/issues/119562 Traceback: https://github.com/wikimedia/pywikibot/actions/runs/9725654092/job/26843242475