Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive WPS323 for date/datetime f-string formatting #2575

Open
AmirKadyrov opened this issue Jan 31, 2023 · 0 comments
Open

False positive WPS323 for date/datetime f-string formatting #2575

AmirKadyrov opened this issue Jan 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@AmirKadyrov
Copy link

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

OS information

@AmirKadyrov AmirKadyrov added the bug Something isn't working label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant