style: format source code using Ruff

This commit is contained in:
jakob.scheid committed 2026-09-21 20:10:04 +02:00
1 parent d9887f34c9
commit aa4a139878
41 files changed
+6061 -5670

No files matched your search

+32 -40
View File
@@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
class NamespaceError(ValueError):
'''
"""
Base class for namespace errors.
'''
"""
def __init__(self, *args: object, namespace_identifier: str = '') -> None:
super().__init__(*args)
self.namespace_identifier = namespace_identifier
@@ -25,23 +27,24 @@ class NamespaceError(ValueError):
return ''
else:
return f'{self.args[0]}{
": "
if self.namespace_identifier and self.args[0]
else ""
}{
self.namespace_identifier
if self.args[0]
else ""
}'
": " if self.namespace_identifier and self.args[0] else ""
}{self.namespace_identifier if self.args[0] else ""}'
class InvalidNamespaceError(NamespaceError): ...
class NamespaceNotFoundError(NamespaceError): ...
class NamespaceExistsError(NamespaceError): ...
class PythonIdentifierError(ValueError):
'''
"""
Base class for Python identifier errors.
'''
"""
def __init__(self, *args: object, identifier: str = '') -> None:
super().__init__(*args)
self.identifier = identifier
@@ -51,21 +54,18 @@ class PythonIdentifierError(ValueError):
return ''
else:
return f'{self.args[0]}{
": "
if self.identifier and self.args[0]
else ""
}{
self.identifier
if self.args[0]
else ""
}'
": " if self.identifier and self.args[0] else ""
}{self.identifier if self.args[0] else ""}'
class InvalidPythonIdentifierError(PythonIdentifierError): ...
class PythonAnnotationError(ValueError):
'''
"""
Base class for Python annotation errors.
'''
"""
def __init__(self, *args: object, annotation: str = '') -> None:
super().__init__(*args)
self.annotation = annotation
@@ -75,21 +75,18 @@ class PythonAnnotationError(ValueError):
return ''
else:
return f'{self.args[0]}{
": "
if self.annotation and self.args[0]
else ""
}{
self.annotation
if self.args[0]
else ""
}'
": " if self.annotation and self.args[0] else ""
}{self.annotation if self.args[0] else ""}'
class InvalidPythonAnnotationError(PythonAnnotationError): ...
class PythonDefinitionError(ValueError):
'''
"""
Base class for Python definition errors.
'''
"""
def __init__(self, *args: object, definition: str = '') -> None:
super().__init__(*args)
self.definition = definition
@@ -99,13 +96,8 @@ class PythonDefinitionError(ValueError):
return ''
else:
return f'{self.args[0]}{
": "
if self.definition and self.args[0]
else ""
}{
self.definition
if self.args[0]
else ""
}'
": " if self.definition and self.args[0] else ""
}{self.definition if self.args[0] else ""}'
class PythonArgumentStructureError(PythonDefinitionError): ...