wemake-python-styleguide
wemake-python-styleguide copied to clipboard
False positive WPS323 for date/datetime f-string formatting
What's wrong
F-string formatting for date/datetime triggers false positive for WPS323
Example:
from datetime import date
current_date = date.today()
print(f"{current_date:%d.%m.%Y}")
Ouput:
WPS323: Found `%` string formatting
How it should be
No warning
Flake8 version and plugins
{ "dependencies": [], "platform": { "python_implementation": "CPython", "python_version": "3.9.13", "system": "Darwin" }, "plugins": [ { "is_local": false, "plugin": "flake8-bandit", "version": "3.0.0" }, { "is_local": false, "plugin": "flake8-broken-line", "version": "0.5.0" }, { "is_local": false, "plugin": "flake8-bugbear", "version": "22.12.6" }, { "is_local": false, "plugin": "flake8-comprehensions", "version": "3.10.1" }, { "is_local": false, "plugin": "flake8-darglint", "version": "1.8.1" }, { "is_local": false, "plugin": "flake8-debugger", "version": "4.1.2" }, { "is_local": false, "plugin": "flake8-docstrings", "version": "1.7.0, pydocstyle: 6.3.0" }, { "is_local": false, "plugin": "flake8-eradicate", "version": "1.4.0" }, { "is_local": false, "plugin": "flake8-string-format", "version": "0.3.0" }, { "is_local": false, "plugin": "flake8_commas", "version": "2.1.0" }, { "is_local": false, "plugin": "flake8_isort", "version": "4.2.0" }, { "is_local": false, "plugin": "flake8_quotes", "version": "3.3.2" }, { "is_local": false, "plugin": "mccabe", "version": "0.6.1" }, { "is_local": false, "plugin": "naming", "version": "0.13.2" }, { "is_local": false, "plugin": "pycodestyle", "version": "2.8.0" }, { "is_local": false, "plugin": "pyflakes", "version": "2.4.0" }, { "is_local": false, "plugin": "rst-docstrings", "version": "0.2.7" }, { "is_local": false, "plugin": "wemake_python_styleguide", "version": "0.17.0" } ], "version": "4.0.1" }
pip information
pip 21.1.2
astor==0.8.1 attrs==22.2.0 bandit==1.7.4 darglint==1.8.1 docutils==0.19 eradicate==2.1.0 flake8==4.0.1 flake8-bandit==3.0.0 flake8-broken-line==0.5.0 flake8-bugbear==22.12.6 flake8-commas==2.1.0 flake8-comprehensions==3.10.1 flake8-debugger==4.1.2 flake8-docstrings==1.7.0 flake8-eradicate==1.4.0 flake8-isort==4.2.0 flake8-polyfill==1.0.2 flake8-quotes==3.3.2 flake8-rst-docstrings==0.2.7 flake8-string-format==0.3.0 gitdb==4.0.10 GitPython==3.1.30 isort==5.12.0 mccabe==0.6.1 pbr==5.11.1 pep8-naming==0.13.2 pycodestyle==2.8.0 pydocstyle==6.3.0 pyflakes==2.4.0 Pygments==2.14.0 PyYAML==6.0 restructuredtext-lint==1.4.0 smmap==5.0.0 snowballstemmer==2.2.0 stevedore==4.1.1 typing-extensions==4.4.0 wemake-python-styleguide==0.17.0