Format Python bindings code using Ruff

- Use double quotes (Ruff/Black default)
- Configure some set of linters to use with Ruff
This commit is contained in:
Lauri Virtanen
2024-08-31 13:43:49 +03:00
parent 4738d16c6f
commit 6bd1d28e26
4 changed files with 54 additions and 55 deletions

View File

@@ -14,16 +14,16 @@ from ._limbo import (
)
__all__ = [
'__version__',
'Connection',
'Cursor',
'InterfaceError',
'DatabaseError',
'DataError',
'OperationalError',
'IntegrityError',
'InternalError',
'ProgrammingError',
'NotSupportedError',
'connect',
"__version__",
"Connection",
"Cursor",
"InterfaceError",
"DatabaseError",
"DataError",
"OperationalError",
"IntegrityError",
"InternalError",
"ProgrammingError",
"NotSupportedError",
"connect",
]

View File

@@ -51,9 +51,7 @@ class Cursor:
]
rowcount: int
def execute(
self, sql: str, parameters: Optional[Tuple[Any, ...]] = None
) -> "Cursor":
def execute(self, sql: str, parameters: Optional[Tuple[Any, ...]] = None) -> "Cursor":
"""
Prepares and executes a SQL statement using the connection.
@@ -65,9 +63,7 @@ class Cursor:
"""
...
def executemany(
self, sql: str, parameters: Optional[List[Tuple[Any, ...]]] = None
) -> None:
def executemany(self, sql: str, parameters: Optional[List[Tuple[Any, ...]]] = None) -> None:
"""
Executes a SQL command against all parameter sequences or mappings found in the sequence `parameters`.
@@ -136,12 +132,17 @@ class DatabaseError(Error):
...
class DataError(DatabaseError):
"""Exception raised for errors due to problems with the processed data like division by zero, numeric value out of range, etc."""
"""
Exception raised for errors due to problems with the processed data like division by zero, numeric value out of
range, etc.
"""
...
class OperationalError(DatabaseError):
"""Exception raised for errors related to the databases operation, not necessarily under the programmer's control."""
"""
Exception raised for errors related to the databases operation, not necessarily under the programmer's control.
"""
...
@@ -151,12 +152,18 @@ class IntegrityError(DatabaseError):
...
class InternalError(DatabaseError):
"""Exception raised when the database encounters an internal error, e.g., cursor is not valid anymore, transaction out of sync."""
"""
Exception raised when the database encounters an internal error, e.g., cursor is not valid anymore, transaction out
of sync.
"""
...
class ProgrammingError(DatabaseError):
"""Exception raised for programming errors, e.g., table not found, syntax error in SQL, wrong number of parameters specified."""
"""
Exception raised for programming errors, e.g., table not found, syntax error in SQL, wrong number of parameters
specified.
"""
...