Skip to content

Commit

Permalink
Update Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Dec 3, 2024
1 parent 6a111d6 commit a60ce7b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
18 changes: 9 additions & 9 deletions src/structlog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,25 @@
"BoundLoggerBase",
"BytesLogger",
"BytesLoggerFactory",
"configure_once",
"DropEvent",
"PrintLogger",
"PrintLoggerFactory",
"ReturnLogger",
"ReturnLoggerFactory",
"WriteLogger",
"WriteLoggerFactory",
"configure",
"configure_once",
"contextvars",
"dev",
"DropEvent",
"getLogger",
"get_config",
"get_context",
"get_logger",
"getLogger",
"is_configured",
"make_filtering_bound_logger",
"PrintLogger",
"PrintLoggerFactory",
"processors",
"reset_defaults",
"ReturnLogger",
"ReturnLoggerFactory",
"stdlib",
"testing",
"threadlocal",
Expand All @@ -86,8 +88,6 @@
"types",
"typing",
"wrap_logger",
"WriteLogger",
"WriteLoggerFactory",
]


Expand Down
2 changes: 1 addition & 1 deletion src/structlog/_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class BytesLogger:
.. versionadded:: 20.2.0
"""

__slots__ = ("_file", "_write", "_flush", "_lock")
__slots__ = ("_file", "_flush", "_lock", "_write")

def __init__(self, file: BinaryIO | None = None):
self._file = file or sys.stdout.buffer
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@

__all__ = [
"ConsoleRenderer",
"better_traceback",
"plain_traceback",
"rich_traceback",
"better_traceback",
]

_IS_WINDOWS = sys.platform == "win32"
Expand Down
8 changes: 4 additions & 4 deletions src/structlog/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@

__all__ = [
"NAME_TO_LEVEL", # some people rely on it being here
"add_log_level",
"CallsiteParameter",
"CallsiteParameterAdder",
"dict_tracebacks",
"EventRenamer",
"ExceptionPrettyPrinter",
"format_exc_info",
"JSONRenderer",
"KeyValueRenderer",
"StackInfoRenderer",
"TimeStamper",
"UnicodeDecoder",
"UnicodeEncoder",
"add_log_level",
"dict_tracebacks",
"format_exc_info",
]


Expand Down Expand Up @@ -472,7 +472,7 @@ class TimeStamper:
.. versionchanged:: 19.2.0 Can be pickled now.
"""

__slots__ = ("_stamper", "fmt", "utc", "key")
__slots__ = ("_stamper", "fmt", "key", "utc")

def __init__(
self,
Expand Down
14 changes: 7 additions & 7 deletions src/structlog/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@


__all__ = [
"add_log_level_number",
"add_log_level",
"add_logger_name",
"ExtraAdder",
"BoundLogger",
"filter_by_level",
"get_logger",
"ExtraAdder",
"LoggerFactory",
"PositionalArgumentsFormatter",
"ProcessorFormatter",
"add_log_level",
"add_log_level_number",
"add_logger_name",
"filter_by_level",
"get_logger",
"recreate_defaults",
"render_to_log_kwargs",
]
Expand Down Expand Up @@ -521,7 +521,7 @@ class AsyncBoundLogger:
Callsite parameters are now also collected for async log methods.
"""

__slots__ = ("sync_bl", "_loop")
__slots__ = ("_loop", "sync_bl")

#: The wrapped synchronous logger. It is useful to be able to log
#: synchronously occasionally.
Expand Down
6 changes: 3 additions & 3 deletions src/structlog/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@


__all__ = (
"WrappedLogger",
"BindableLogger",
"Context",
"EventDict",
"Processor",
"ExcInfo",
"ExceptionRenderer",
"ExceptionTransformer",
"BindableLogger",
"FilteringBoundLogger",
"Processor",
"WrappedLogger",
)
1 change: 1 addition & 0 deletions tests/typing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

def bytes_dumps(
__obj: Any,
/,
default: Callable[[Any], Any] | None = None,
option: int | None = None,
) -> bytes:
Expand Down

0 comments on commit a60ce7b

Please sign in to comment.