Add linter for cython files (#945)

This commit is contained in:
J. Nick Koston 2024-09-03 11:27:33 -10:00 committed by GitHub
parent 172fe532f2
commit 0969e9339d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -28,3 +28,8 @@ repos:
- --force
- --keep-updates
files: ^(aioesphomeapi)/.+\.py$
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
hooks:
- id: cython-lint
- id: double-quote-cython-strings

View File

@ -73,8 +73,10 @@ cpdef void handle_complex_message(
cdef object _handle_timeout
cdef object _handle_complex_message
@cython.dataclasses.dataclass
cdef class ConnectionParams:
cdef public list addresses
cdef public object port
cdef public object password
@ -84,6 +86,7 @@ cdef class ConnectionParams:
cdef public object noise_psk
cdef public object expected_name
cdef class APIConnection:
cdef ConnectionParams _params
@ -137,7 +140,11 @@ cdef class APIConnection:
cpdef void report_fatal_error(self, Exception err)
@cython.locals(handlers=set)
cdef void _add_message_callback_without_remove(self, object on_message, tuple msg_types)
cdef void _add_message_callback_without_remove(
self,
object on_message,
tuple msg_types
)
cpdef add_message_callback(self, object on_message, tuple msg_types)