ruff/crates/ruff_linter/resources/test/fixtures/flake8_logging
Hmvp 49763a7f7c
[flake8-logging] Avoid false positive for exc_info=True outside logger.exception (LOG014) (#18737)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

Fixes https://github.com/astral-sh/ruff/issues/18726 by also checking if
its a literal and not only that it is truthy. See also the first comment
in the issue.

It would have been nice to check for inheritance of BaseException but I
figured that is not possible yet...

## Test Plan

I added a few tests for valid input to exc_info
2025-06-20 14:43:08 -04:00
..
LOG001.py
LOG002.py
LOG004_0.py [flake8-logging] .exception() and exc_info= outside exception handlers (LOG004, LOG014) (#15799) 2025-02-04 09:52:12 +01:00
LOG004_1.py [flake8-logging] .exception() and exc_info= outside exception handlers (LOG004, LOG014) (#15799) 2025-02-04 09:52:12 +01:00
LOG007.py
LOG009.py
LOG014_0.py [flake8-logging] Avoid false positive for exc_info=True outside logger.exception (LOG014) (#18737) 2025-06-20 14:43:08 -04:00
LOG014_1.py [flake8-logging] .exception() and exc_info= outside exception handlers (LOG004, LOG014) (#15799) 2025-02-04 09:52:12 +01:00
LOG015.py