ruff
bccba5d7 - [`flake8-logging`] Implement `LOG007`: `ExceptionWithoutExcInfo` (#7410)

Commit
1 year ago
[`flake8-logging`] Implement `LOG007`: `ExceptionWithoutExcInfo` (#7410) ## Summary This PR implements a new rule for `flake8-logging` plugin that checks for uses of `logging.exception()` with `exc_info` set to `False` or a falsy value. It suggests using `logging.error` in these cases instead. I am unsure about the name. Open to suggestions there, went with the most explicit name I could think of in the meantime. Refer https://github.com/astral-sh/ruff/issues/7248 ## Test Plan Added a new fixture cases and ran `cargo test`
Author
Parents
  • crates/ruff
    • resources/test/fixtures/flake8_logging
      • File
        LOG007.py
    • src
      • checkers/ast/analyze
        • File
          expression.rs
      • File
        codes.rs
      • rules/flake8_logging
        • File
          mod.rs
        • rules
          • File
            exception_without_exc_info.rs
          • File
            mod.rs
        • snapshots
          • ruff__rules__flake8_logging__tests__LOG007_LOG007.py.snap
  • File
    ruff.schema.json