pyproject.toml - enableTypeIgnoreComments=false

This commit is contained in:
Andrej730
2025-05-16 18:12:33 +05:00
parent 4ea9a598c7
commit 68d967c2e5
8 changed files with 14 additions and 12 deletions
+2
View File
@@ -36,3 +36,5 @@ extend-exclude = '''
reportInvalidTypeForm = false
disableBytesTypePromotions = true
reportUnnecessaryTypeIgnoreComment = true
# Just to add a quick insert of `# pyright: ignore[xxx]` comments in Pylance.
enableTypeIgnoreComments = false
+1 -1
View File
@@ -20,7 +20,7 @@ def get_extensions_attributes(extensions: Extensions) -> dict[str, AttributeData
- subattribute name"""
possible_attributes = {}
for field in fields(type(extensions)):
field_type = field.type.__args__[0] # type: ignore [reportAttributeAccessIssue]
field_type = field.type.__args__[0] # pyright: ignore [reportAttributeAccessIssue]
subfield = next(iter(fields(field_type)))
xsd_name = subfield.metadata["name"]
possible_attributes[field.name] = AttributeData(field_type, subfield.name, xsd_name)
@@ -268,7 +268,7 @@ class AssignCostItemQuantity(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Assign Cost Item Quantity"
bl_options = {"REGISTER", "UNDO"}
cost_item: bpy.props.IntProperty()
related_object_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
related_object_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=[(i, i, "") for i in get_args(tool.Cost.RELATED_OBJECT_TYPE)],
)
prop_name: bpy.props.StringProperty()
@@ -745,7 +745,7 @@ class ClearCostItemAssignments(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Clear Cost Item Product Assignments"
bl_options = {"REGISTER", "UNDO"}
cost_item: bpy.props.IntProperty()
related_object_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
related_object_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=[(i, i, "") for i in get_args(tool.Cost.RELATED_OBJECT_TYPE)],
)
@@ -569,7 +569,7 @@ class AlignProduct(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}
AlignType = Literal["CENTERLINE", "POSITIVE", "NEGATIVE"]
align_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
align_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=[(i, i, "") for i in get_args(AlignType)]
)
+1 -1
View File
@@ -133,7 +133,7 @@ class AlignWall(bpy.types.Operator):
'Int.': align to the INTERIOR face"""
AlignType = Literal["CENTER", "EXTERIOR", "INTERIOR"]
align_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
align_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=((i, i, "") for i in get_args(AlignType))
)
@@ -512,7 +512,7 @@ class AssignProcess(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Assign Process"
bl_options = {"REGISTER", "UNDO"}
task: bpy.props.IntProperty()
related_object_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
related_object_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=[(i, i, "") for i in get_args(tool.Sequence.RELATED_OBJECT_TYPE)],
)
related_object: bpy.props.IntProperty()
@@ -549,7 +549,7 @@ class UnassignProcess(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Unassign Process"
bl_options = {"REGISTER", "UNDO"}
task: bpy.props.IntProperty()
related_object_type: bpy.props.EnumProperty( # type: ignore [reportRedeclaration]
related_object_type: bpy.props.EnumProperty( # pyright: ignore [reportRedeclaration]
items=[(i, i, "") for i in get_args(tool.Sequence.RELATED_OBJECT_TYPE)],
)
related_object: bpy.props.IntProperty()
+4 -4
View File
@@ -287,11 +287,11 @@ AttributeSpecialType = Literal["", "DATE", "DATETIME", "LENGTH", "AREA", "VOLUME
class Attribute(PropertyGroup):
tooltip = "`Right Click > IFC Description` to read the attribute description and online documentation"
name: StringProperty(name="Name") # type: ignore [reportRedeclaration]
name: StringProperty(name="Name") # pyright: ignore [reportRedeclaration]
display_name: StringProperty(name="Display Name", get=get_display_name)
description: StringProperty(name="Description") # type: ignore [reportRedeclaration]
ifc_class: StringProperty(name="Ifc Class") # type: ignore [reportRedeclaration]
data_type: EnumProperty( # type: ignore [reportRedeclaration]
description: StringProperty(name="Description") # pyright: ignore [reportRedeclaration]
ifc_class: StringProperty(name="Ifc Class") # pyright: ignore [reportRedeclaration]
data_type: EnumProperty( # pyright: ignore [reportRedeclaration]
name="Data Type",
items=[(i, i, "") for i in get_args(AttributeDataType)],
)
@@ -142,7 +142,7 @@ def get_representation(
:param target_view: A TargetView string, or any if left blank.
:return: The first IfcShapeRepresentation matching the criteria.
"""
for r in get_representations_iter(element): # type: ignore
for r in get_representations_iter(element):
if is_representation_of_context(r, context, subcontext, target_view):
return r