Skip to content

Commit 51a676e

Browse files
committed
Resolve some linting errors
1 parent d9373d8 commit 51a676e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/peakrdl_python/unique_component_iterator.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ def accesswidth(self) -> int:
184184
"""
185185
return get_reg_accesswidth(self.instance)
186186

187-
def lookup_field_data_python_class(self, field: FieldNode) -> str:
187+
def lookup_field_data_python_class(self, field_node: FieldNode) -> str:
188188
"""
189189
Helper function to lookup the class name of a field node
190190
"""
191191

192-
if not isinstance(field, FieldNode):
193-
raise TypeError(f'Only fields should use this method, got {type(field)}')
192+
if not isinstance(field_node, FieldNode):
193+
raise TypeError(f'Only fields should use this method, got {type(field_node)}')
194194

195-
field_hash = self.parent_walker.calculate_or_lookup_hash(node=field)
195+
field_hash = self.parent_walker.calculate_or_lookup_hash(node=field_node)
196196
if field_hash is None:
197197
return 'int'
198198

@@ -299,6 +299,7 @@ class UniqueComponents(RDLListener):
299299
class intended to be used as part of the walker/listener protocol to find all the items
300300
non-hidden nodes
301301
"""
302+
# pylint:disable=too-many-instance-attributes
302303

303304
def __init__(self,
304305
hide_node_callback: HideNodeCallback,
@@ -495,6 +496,10 @@ def python_class_name(self, node: Node, async_library_classes: bool) -> str:
495496
return python_class_name
496497

497498
def calculate_or_lookup_hash(self, node: Node) -> Optional[int]:
499+
"""
500+
Calculates the hash for a node with an option to retrieve it from the cache to avoid it
501+
being redone if possible
502+
"""
498503

499504
full_instance_name = '.'.join(node.get_path_segments())
500505
if full_instance_name in self.__name_hash_cache:

0 commit comments

Comments
 (0)