ruff/crates
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
..
flake8_to_ruff Bump version to 0.0.280 (#5965) 2023-07-21 22:36:13 -04:00
ruff Allow specification of logging.Logger re-exports via logger-objects (#5750) 2023-07-24 00:38:20 -04:00
ruff_benchmark Make lint_only aware of the source kind (#5876) 2023-07-19 09:29:35 +05:30
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
ruff_dev Filter off-by-default RUF014 out of schema (#5832) 2023-07-19 21:06:10 +00:00
ruff_diagnostics Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_formatter Playground: Fix escaped quotes handling (#5906) 2023-07-20 09:25:27 +00:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_python_ast Remove __all__ enforcement rules out of binding phase (#5897) 2023-07-19 21:18:47 +00:00
ruff_python_formatter Formatter: Add EmptyWithDanglingComments helper (#5951) 2023-07-23 14:32:16 +02:00
ruff_python_resolver Fix CI by downgrading to cargo insta 1.29.0 (#5589) 2023-07-08 14:54:49 +00:00
ruff_python_semantic Allow specification of logging.Logger re-exports via logger-objects (#5750) 2023-07-24 00:38:20 -04:00
ruff_python_stdlib Use a match statement for builtin detection (#5798) 2023-07-16 04:57:57 +00:00
ruff_python_trivia SimpleTokenizer: Fix infinite loop when lexing empty quotes (#5917) 2023-07-20 15:18:35 +02:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_shrinking Document formatter error shrinking (#5915) 2023-07-21 11:32:12 +02:00
ruff_textwrap Rename ruff_python_whitespace to ruff_python_trivia (#5886) 2023-07-19 11:48:27 -04:00
ruff_wasm Allow specification of logging.Logger re-exports via logger-objects (#5750) 2023-07-24 00:38:20 -04:00