Skip to content

Allow logging.critical to bypass BLE001 #19519

@clockback

Description

@clockback

Summary

At present, the rule BLE001not be tripped by the following:

import logging


try:
    print("Hello World!")
except Exception:
    logging.error("Could not run.", exc_info=True)

But it will be tripped by the following:

import logging


try:
    print("Hello World!")
except Exception:
    logging.critical("Could not run.", exc_info=True)

Doesn't seem that there is any principled reason to allow the former but not the latter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions