ruff: PLE1205 and loguru "false positive"
Not sure if this is something that can actually be done, but I figured it might be worth mentioning, in case someone else runs into this as it took me a bit (longer than it should have anyway) to realize that the check seems specific to the base logging module.
It can obviously be set as an ignore but I think it would be great if Ruff could detect in the PLE1205 check that Loguru is being used and ignore the lines or check that they are properly formatted for the module that’s being used.
from loguru import logger
filename = "test_file.txt"
directory = "/tmp"
logger.info("Downloaded {} to {} successfully", filename, directory)
ruff --version
ruff 0.0.254
ruff test.py --select=PLE
test.py:5:1: PLE1205 Too many arguments for `logging` format string
|
5 | logger.info("Downloaded {} to {} successfully", filename, directory)
| ^^^^^^^^^^^ PLE1205
|
Found 1 error.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 17 (8 by maintainers)
Commits related to this issue
- Ignore `PLE1205` due to charliermarsh/ruff#3351 — committed to vkbottle/vkbottle by FeeeeK a year ago
I think the original issue here is resolved, Ruff no longer flags imports from modules apart from
logging
.