Configuring Prefix and Suffix Rules

There are several rules that enforce specific prefixes or suffixes in different name identifiers. It is noted in the documentation, what the default prefixes and suffixes are for each such rule.

All prefix and suffix rules are disabled by default. The defaults for each of these rules can be overridden using a configuration.

Note

Some elements have both prefix and suffix rules. Depending on the desired style, either or both can be enabled.

Overriding Default Prefix Enforcement

The default setting can be changed using a configuration. The rule variable_012 defaults to following prefix: [‘v_’]. We can use the following configuration to change allowed prefix:

---

 rule :
     variable_012:
         # Each prefix rule needs to be enabled explicitly.
         disable: false
         prefixes: ['var_']

Overriding Default Suffix Enforcement

The default setting can be changed using a configuration. For example, the rule port_025 defaults to following suffixes: [‘_I’, ‘_O’, ‘_IO’]. We can use the following configuration to change allowed suffixes:

---

 rule :
     port_025:
         # Each suffix rule needs to be enabled explicitly.
         disable: false
         suffixes: ['_i', '_o']

Rules Enforcing Prefixes and Suffixes

Element Prefix Rule Suffix Rule
Block Label block_601 block_600
Constant Identifier constant_015 constant_600
Generate Label generate_017 generate_600
Generic Identifier generic_020 generic_600
Generic Map Identifier generic_map_601 generic_map_600
Package Identifier package_017 package_016
Package Body Identifier package_body_601 package_body_600
Port Identifier port_011 port_025
Process Label process_036 process_600
Signal Identifier signal_008 signal_600
Subtype Identifier subtype_004 subtype_600
Type Identifier type_definition_015 type_definition_600
Variable Identifier variable_012 variable_600