Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
hooks:
- id: check-bash-syntax
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v1.16.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that we are currently installing the latest version of mypy when executing the various Python 3.x tests using nox (e.g. see https://github.com/elastic/ecs-logging-python/blob/main/noxfile.py#L54) hence there was a discrepancy here when running precommit tests, that was surfacing non-existent errors.

hooks:
- id: mypy
args:
Expand Down
7 changes: 1 addition & 6 deletions ecs_logging/_stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
_LOGRECORD_DIR = set()


def _converter(secs: Optional[float] = None) -> time.struct_time:
return time.gmtime(secs)


class StdlibFormatter(logging.Formatter):
"""ECS Formatter for the standard library ``logging`` module"""

Expand Down Expand Up @@ -77,8 +73,7 @@ class StdlibFormatter(logging.Formatter):
"process",
"message",
} | _LOGRECORD_DIR

convert = _converter
converter: Callable[[Optional[float]], time.struct_time] = staticmethod(time.gmtime)

def __init__(
self,
Expand Down