Skip to content

Detect missing arguments in logging format strings #9999

@sam-s

Description

@sam-s

Current problem

The following error should be easily detectable:

import logging
logging.info("foo %s")  # missing format arg

the missing arguments should be easily detectable, like we already get too-many-format-args on

logging.warning("foo",1,2,3) # extra format args

Desired solution

I want pylint to issue the too-few-format-args error on the above code.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Negative 🦋No message is emitted but something is wrong with the codeGood first issueFriendly and approachable by new contributorsHelp wanted 🙏Outside help would be appreciated, good for new contributorsNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions