wemake-python-styleguide icon indicating copy to clipboard operation
wemake-python-styleguide copied to clipboard

False positive WPS323 with logging configuration

Open fpuga opened this issue 2 years ago • 0 comments

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 avatar Apr 27 '23 14:04 fpuga