Configuring Whitespace Rules¶
There are rules which will check for a whitespace between keywords or keywords and identifiers. The number of spaces can be configured to allow for multiple or no whitespaces.
There are a couple of options to these rules:
Option | Description |
---|---|
number_of_spaces | Determines the number of whitespace characters to allow. |
The number_of_spaces
option can accept several values:
Value | Description |
---|---|
[0-9][0-9]* | The number of spaces to enforce. |
>[0-9][0-9]* | The minimum number of spaces to enforce. |
>=[0-9][0-9]* | The minimum number of spaces to enforce. |
[0-9][0-9]*+ | The minimum number of spaces to enforce. |
These options combined with the values allow complete control over the number of whitespaces allowed.
Example: enforce one whitespace between end and architecture¶
rule :
architecture_012:
number_of_spaces: 1
In this example, the number of whitespaces between the keywords must be 1.
end architecture;
Example: enforce two whitespaces between end and architecture¶
rule :
architecture_012:
number_of_spaces: 2
In this example, the number of whitespaces between the keywords must be 2.
end architecture;
Example: allow at least 1 space before a colon¶
rule :
signal_006:
number_of_spaces: '>=1'
In this example, there must be at least a single whitespace before the colon. All of these would not be a violation.
signal wr_en : std_logic;
signal wr_en : std_logic;
signal wr_en : std_logic;
The same result could be achieved using this yaml:
rule :
signal_006:
number_of_spaces: '1+'
Rules Enforcing Whitespace¶
- alias_declaration_100
- alias_declaration_101
- alias_declaration_102
- architecture_012
- architecture_022
- architecture_030
- architecture_031
- architecture_032
- architecture_033
- attribute_declaration_100
- attribute_specification_100
- block_100
- block_101
- case_002
- case_003
- case_004
- case_006
- component_002
- component_007
- component_011
- component_013
- concurrent_004
- constant_005
- constant_100
- context_002
- context_017
- context_018
- context_019
- context_ref_002
- element_association_100
- entity_002
- entity_007
- entity_specification_100
- function_100
- function_101
- generate_002
- generate_008
- generate_013
- generate_014
- generic_003
- generic_005
- if_003
- if_004
- if_005
- if_015
- instantiation_002
- instantiation_003
- instantiation_032
- iteration_scheme_100
- iteration_scheme_101
- library_002
- library_006
- loop_statement_100
- loop_statement_101
- loop_statement_102
- loop_statement_104
- package_002
- package_009
- package_body_100
- package_body_101
- procedure_100
- procedure_101
- process_002
- process_007
- process_014
- process_024
- process_025
- record_type_definition_100
- record_type_definition_101
- sequential_002
- signal_005
- type_definition_006
- type_definition_007
- variable_005
- variable_assignment_002
- whitespace_007