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 with logging configuration #2638

Open
fpuga opened this issue Apr 27, 2023 · 0 comments
Open

False positive WPS323 with logging configuration #2638

fpuga opened this issue Apr 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@fpuga
Copy link

fpuga commented Apr 27, 2023

What's wrong

I have a Django app and in settings.py I configure logging like this:

LOGGING = {
    // some settings
    "formatters": {
        "app": {
            "format": (
                "%(asctime)s [%(levelname)-8s] "  // WPS323
                "(%(module)s.%(funcName)s) %(message)s" // WPS323
            ),
            "datefmt": "%Y-%m-%d %H:%M:%S", // WPS323
        }
    },
}

The lines marked are raising a WPS323 warning.

How it should be

IMHO this is a false positive and % should be excluded from logging config.

EDIT:

After posting the bug i found #1304 that is a bit similar. Maybe if this is the expected behaviour adding a note in the documentation of would be a good idea.

Flake8 version and plugins

wemake_python_styleguide==0.17.0

pip information

pip==23.1.1

OS information

Ubuntu 20.04.6 LTS

@fpuga fpuga added the bug Something isn't working label Apr 27, 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