.. _configuring-whitespace-rules: 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. | +--------------------------+----------------------------------------------------------+ .. | align_to_next_tab | When true, will add spaces to align with next valid tab. | .. +--------------------------+----------------------------------------------------------+ The :code:`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 ############################################################## .. code-block:: yaml rule : architecture_012: number_of_spaces: 1 In this example, the number of whitespaces between the keywords must be 1. .. code-Block:: vhdl end architecture; Example: enforce two whitespaces between end and architecture ############################################################## .. code-block:: yaml rule : architecture_012: number_of_spaces: 2 In this example, the number of whitespaces between the keywords must be 2. .. code-Block:: vhdl end architecture; Example: allow at least 1 space before a colon ############################################### .. code-block:: yaml 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. .. code-Block:: vhdl signal wr_en : std_logic; signal wr_en : std_logic; signal wr_en : std_logic; The same result could be achieved using this yaml: .. code-block:: yaml rule : signal_006: number_of_spaces: '1+' Rules Enforcing Whitespace ########################## * `alias_declaration_100 `_ * `alias_declaration_101 `_ * `alias_declaration_102 `_ * `alias_declaration_103 `_ * `architecture_012 `_ * `architecture_022 `_ * `architecture_030 `_ * `architecture_031 `_ * `architecture_032 `_ * `architecture_033 `_ * `assert_100 `_ * `assert_101 `_ * `assert_102 `_ * `attribute_declaration_100 `_ * `attribute_declaration_101 `_ * `attribute_specification_100 `_ * `attribute_specification_101 `_ * `block_100 `_ * `block_101 `_ * `case_002 `_ * `case_003 `_ * `case_004 `_ * `case_005 `_ * `case_006 `_ * `comment_004 `_ * `component_002 `_ * `component_007 `_ * `component_011 `_ * `component_013 `_ * `concurrent_002 `_ * `concurrent_004 `_ * `conditional_expressions_100 `_ * `conditional_expressions_101 `_ * `conditional_expressions_102 `_ * `conditional_expressions_103 `_ * `conditional_waveforms_100 `_ * `conditional_waveforms_101 `_ * `conditional_waveforms_102 `_ * `conditional_waveforms_103 `_ * `constant_005 `_ * `constant_006 `_ * `constant_010 `_ * `constant_100 `_ * `constant_101 `_ * `context_002 `_ * `context_017 `_ * `context_018 `_ * `context_019 `_ * `context_ref_002 `_ * `element_association_100 `_ * `element_association_101 `_ * `entity_002 `_ * `entity_007 `_ * `entity_011 `_ * `entity_013 `_ * `entity_specification_100 `_ * `entity_specification_101 `_ * `file_100 `_ * `function_100 `_ * `function_101 `_ * `generate_002 `_ * `generate_008 `_ * `generate_013 `_ * `generate_014 `_ * `generic_003 `_ * `generic_005 `_ * `generic_006 `_ * `generic_014 `_ * `generic_map_006 `_ * `generic_map_007 `_ * `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_103 `_ * `loop_statement_104 `_ * `package_002 `_ * `package_009 `_ * `package_body_100 `_ * `package_body_101 `_ * `port_003 `_ * `port_020 `_ * `port_map_007 `_ * `procedure_100 `_ * `procedure_101 `_ * `procedure_call_100 `_ * `procedure_call_101 `_ * `process_002 `_ * `process_007 `_ * `process_014 `_ * `process_024 `_ * `process_025 `_ * `record_type_definition_100 `_ * `record_type_definition_101 `_ * `report_statement_100 `_ * `report_statement_101 `_ * `selected_assignment_100 `_ * `selected_assignment_101 `_ * `selected_assignment_102 `_ * `selected_assignment_103 `_ * `selected_assignment_104 `_ * `selected_assignment_105 `_ * `selected_assignment_106 `_ * `selected_assignment_107 `_ * `sequential_002 `_ * `sequential_003 `_ * `signal_005 `_ * `signal_006 `_ * `signal_100 `_ * `signal_101 `_ * `signal_102 `_ * `subtype_100 `_ * `type_006 `_ * `type_007 `_ * `type_100 `_ * `variable_005 `_ * `variable_006 `_ * `variable_100 `_ * `variable_assignment_002 `_ * `variable_assignment_003 `_ * `whitespace_007 `_