ruff/crates/ruff_python_semantic/src
Charlie Marsh f9726af4ef
Allow specification of logging.Logger re-exports via logger-objects (#5750)
## Summary

This PR adds a `logger-objects` setting that allows users to mark
specific symbols a `logging.Logger` objects. Currently, if a `logger` is
imported, we only flagged it as a `logging.Logger` if it comes exactly
from the `logging` module or is `flask.current_app.logger`.

This PR allows users to mark specific loggers, like
`logging_setup.logger`, to ensure that they're covered by the
`flake8-logging-format` rules and others.

For example, if you have a module `logging_setup.py` with the following
contents:

```python
import logging

logger = logging.getLogger(__name__)
```

Adding `"logging_setup.logger"` to `logger-objects` will ensure that
`logging_setup.logger` is treated as a `logging.Logger` object when
imported from other modules (e.g., `from logging_setup import logger`).

Closes https://github.com/astral-sh/ruff/issues/5694.
2023-07-24 00:38:20 -04:00
..
analyze Allow specification of logging.Logger re-exports via logger-objects (#5750) 2023-07-24 00:38:20 -04:00
binding.rs Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
context.rs Remove separate ReferenceContext enum (#4631) 2023-05-24 15:12:38 +00:00
definition.rs Include function name in undocumented-param message (#5818) 2023-07-16 22:51:34 -04:00
globals.rs Make some of ruff_python_semantic pub(crate) (#5093) 2023-06-14 17:49:37 +00:00
lib.rs Move StarImport to its own module (#5186) 2023-06-20 13:12:46 -04:00
model.rs Store flags rather than ExecutionContext on references (#6006) 2023-07-23 02:54:39 +00:00
node.rs Make some of ruff_python_semantic pub(crate) (#5093) 2023-06-14 17:49:37 +00:00
reference.rs Store flags rather than ExecutionContext on references (#6006) 2023-07-23 02:54:39 +00:00
scope.rs Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
star_import.rs Move StarImport to its own module (#5186) 2023-06-20 13:12:46 -04:00