Derived from the flake8-logging linter.
Fix is sometimes available.
This rule is unstable and in preview. The
--preview flag is required for use.
What it does#
Checks for any usage of
__file__ as an argument to
Why is this bad?#
The logging documentation recommends this pattern:
__name__ is the fully qualified module name, such as
which is the intended format for logger names.
This rule detects probably-mistaken usage of similar module-level dunder constants:
__cached__- the pathname of the module's compiled version, such as
__file__- the pathname of the module, such as