CodingStyle-Naming.Struct

Check naming conventions of struct types

Required inputs: IR

This rule checks named entities in the source code against a configurable naming convention. Options can restrict the scope of the rule.

To modify the naming convention for a sub-aspect of this rule, please use the copy feature to create another instance and use the rules' options (possibly including filter_predicate) to match the required aspects.

Possible Messages

Key

Text

Severity

Disabled

non_compliant_name

Names of struct types shall use pascal case

None

False

Options

additional_checks

additional_checks : list[typing.Tuple[typing.Callable[…, bool], typing.Optional[str]]] = []

Additional list of checks to be run on correctly named and not excluded nodes. For each list entry, specify a pair of a callback and an optional string.
  1. The callback returning True for compliant nodes and False for non-compliant nodes. The callback shall accept parameters:
    1. The first parameter shall be the node to inspect of type ir.Node
    2. Optionally, the callback can accept further parameters. These parameters need an explicitly annotated type and that type shall provide a classmethod to_work_item(). The value of for the arguments is provided by that workitem's result. The order of parameters is significant and shall be equal for all callbacks. This means that the functions can accept different numbers of parameters, but cannot expect them in different orders.
  2. the string as a message text.
 

advanced

Options that need not be modified for most use-cases.
 

advanced.ir_classes : set[str] = {'Class_Type', 'Unnamed_Class_Type'}

IR classes to be matched for this rule. See IR Reference Guide.
 

advanced.part : Part = 'Logical'

Part of the IR classes defined in "ir_classes". See IR Reference Guide.
 

check_renamings

check_renamings : bool = False

Also check this type's convention in renamings of the type (via typedef or using)
 

exceptions

exceptions : set[str] = set()

Set of names, which are allowed although they violate the naming pattern.
 

filter_predicate

filter_predicate : typing.Callable[[bauhaus.ir.Node], bool] | None = None

Python callback function taking one node as parameter returning bool. Return True for relevant nodes on which the naming_convention should be tested. Return False for nodes that should not be considered by this rule.
 

naming_convention

naming_convention : typing.Pattern[str] | None = '^[A-Z][A-Za-z0-9]*$'

Regular expression specifying correct naming for this node kind.
 

Option Types

These types are used by options listed above:

Part

Enum used as type of config options. For all other t
 
  • Common

  • Logical

  • Physical

  • Build