Commit Graph

23 Commits

Author SHA1 Message Date
Jeremiah Leary 6a4f748a87
Issue 850 (#861)
* Updates for issue #850

Adding rules to indent with keyword

  1)  Added documentation
  2)  Added tests
  3)  Added rules:
        concurrent_selected_signal_assignment_300
        selected_force_assignment_300
        selected_variable_assignment_300
        selected_waveform_assignment_300

* Adding the following rules:

  concurrent_selected_signal_assignment_500
  selected_force_assignment_500
  selected_variable_assignment_500
  selected_waveform_assignment_500

* Adding rules:

  concurrent_selected_signal_assignment_501
  selected_force_assignment
  selected_variable_assignment
  selected_waveform_assignment

* Adding rule:

  selected_force_assignment_502

* Fixing documentation.

* Adding rule selected_expressions_500

* Adding rule selected_waveforms_500.

* Adding rules:

  concurrent_selected_signal_assignment_100
  selected_force_assignment_100
  selected_variable_assignment_100
  selected_waveform_assignment_100

* Adding rules:

  concurrent_selected_signal_assignment_101
  selected_force_assignment_101
  selected_variable_assignment_101
  selected_waveform_assignment_101

* Adding rules:

  concurrent_selected_signal_assignment_102
  select_force_assignment_102
  select_variable_assignment_102
  select_waveform_assignment_102

* Adding rules:

  concurrent_selected_signal_assignment_103
  selected_force_assignment_103
  selected_varaible_assignment_103
  selected_waveform_assignment_103

* Adding rules:

  concurrent_selected_signal_assignment_104
  selected_force_assignment_104
  selected_variable_assignment_104
  selected_waveform_assignment_104

* Added rule selected_force_assignment_105.

* Adding rules:

  selected_expressions_100
  selected_waveforms_100

* Adding rules:

  selected_expressions_101
  selected_waveforms_101

* Adding structure base rule.

Adding rule selected_assignment_001

* Refactoring analysis functions to improve readability.

* Adding more options to rule selected_assignment_001.

* Adding documentation for selected_assignment rules.

* Adding rule selected_assignment_100.

* Adding rule selected_assignment_101.

* Adding rule selected_assignment_102.

* Adding rule selected_assignment_103.

* Adding rule selected_assignment_104.

* Adding rule selected_assignment_105.

* Adding rule selected_assignment_106.

* Adding rule selected_assignment_107.

* Removing unused file.

* Adding rule selected_assignment_500.

* Adding rule selected_assignment_501.

* Adding rule selected_assignment_502.

* Adding rule selected_assignment_503.

* Adding rule selected_assignment_300.

* Removing rules which were merged into selected_assignments.

  * concurrent_selected_signal_assignment
  * selected_force_assignment
  * selected_variable_assignment
  * selected_waveforms

* Updating indenting on selected with and semicolon keywords.

* Deprecating rule with_001.

* Adding rule selected_assignment_400.

Minor update to multiline_alignment_between_tokens base rule to support selected_assignment_400.

* Fixing yaml configuration.

* Fixing tags.

* Fixing last yaml example.

* Removing rule selected_assignment_001

* Removing unused directories.

* Fixing documentation links.

* Saving previous rule_001 to a temporary file.

* Adding rule selected_assignment_001

* Adding rule selected_assignment_002.

* Adding rule selected_assignment_003

* Adding rule selected_assignment_004.

* Removing subphase from rules.

* Adding rule selected_assingment_005.

* Adding rule selected_assignment_006.

* Fixing issue in base rule where processing order was not being preserved.

* Adding rule selected_assignment_007.

* Adding rule selected_assignment_008.

* Updated base rule to accept token pairs.

* Updating rule to use token pairs.

* Adding rule selected_assignment_009.

* Adding rule selected_assignment_010.

* Adding rule selected_assignment_011.

* Adding rule selected_assignment_012.

* Minor update to rule documentatin.
2022-12-13 18:06:54 -06:00
Jeremiah Leary e408ec8997
Issue 854 (#857)
* Updates for issue #854

Fixing array detection logic in base rule multiline_array_alignment.

* Updating array detection logic in multiline_structure base rule.

* Refactoring to improve readability.
2022-11-07 05:55:40 -06:00
Jeremiah Leary 9f65068692
Updates for issue #559: (#798)
* Updates for issue #559:

Adding documentation for configuring indent rules.

* Adding documentation:

  1)  Updated whitespace_002
  2)  Added whitespace_014
  3)  Added configuring tabs vs spaces

* Adding example documentation.
Fixing table.

* Updated documentation:

  1)  Removed whitespace_014
  2)  Updated whitespace_002 to only work on middle tabs
  3)  Removed configuring_tabs_vs_spaces document
  4)  Removed tabs as an option for indenting

* Updating token indent rules.

* Adding smart_tabs test for rule assert_statement_001

* Updating rule assert_400 to allow smart tabs.

* Refactoring assert_400 to improve readability.

* Refactoring to reduce complexity.

* Updates for rule case_011 and assert_400:

  1) Replaced align_consecutive_lines_after_line_starting_with_token_and_stopping_with_token with assert_400
  2) Updated rule assert_400 to inherit align rule
  3) Changed rule case_011 to use align rule

* Removing rule case_021.

The function of the rule is now covered by comment_010.

* Deprecating rule case_generate_alternative_300.

* Refactoring analyze to _analyze.

* Splitting configuration of rule assert_400 into its own page.

* Updating multiline_alignment_between_tokens to handle smart tabs.

* Deprecating rules if_032 and if_033.  They are covered by comment_010.

* Updated report_statement_400 to use align_consecutive_lines_after_line_starting_with_token_and_stopping_with_token.

* Updating rule process_028 to handle smart-tabs

 1) Updated tests
 2) Updated base rule align_left_token_with_right_token_if_right_token_starts_a_line

* Updating rule library_009 to handle smart-tabs

  1)  Updated tests
  2)  Updated base rule align_consecutive_lines_starting_with_a_comment_above_line_starting_with_token

* Minor formatting updates.

* Adding methods to support multiline alignment base class.

* Refactored rule constant_012 to split indent and alignment whitespace.

* Adding smart-tab support to rule constant_012.

* Removing old classify code.

* Removing debug print statement.

* Updating documentation for assert and report_statement rules.

* Updating rule concurrent_009 to support smart-tabs.

  1)  Added tests
  2)  Updated rule to support smart-tabs

* Updating documentation to match current implementation.

* Taking a different approach for multiline_alignment_between_tokens.

  1)  Reverted smart_tabs changes
  2)  Updated base rule to method employed on concurrent_009
  3)  Commented out smart_tab tests

* Updated missing meta data to Toi in rule constant_014

Fixed error in align_left_no_align_paren_no analyzer.

* Adding smart-tab support to base rule multiline_alignment_between_tokens.

* Updating alignment rules to support smart tabs.

  1)  Updated base rules
      a) vsg/rules/align_tokens_in_region_between_tokens.py
      b) vsg/rules/align_tokens_in_region_between_tokens_skipping_lines_starting_with_tokens.py
      c) vsg/rules/align_tokens_in_region_between_tokens_unless_between_tokens.py
  2)  Updated rule concurrent_008
  3)  Added tests

* Fixing issue with rule port_map_009 misfiring if the following token sequence occured:  comma, whitespace, carraige return.

* Updating solution for indent rules to give required tabs and spaces.
Fixing several bugs in indent implementation:
  1)  checking for smart-tabs instead of smart_tabs

* Updates for Codacy issues.

* Additional Codacy updates.

* Fixing style issues identified by CodeClimate.

* Additional style fixes identified by CodeClimate.

* Refactoring alignment rules:

  1)  Created utils file specifically for alignment rules
  2)  Refactored rules to move identical code into utils file

* Moving update_column_width into alignment_utils file.

* Moving functions into alignment_utils:
  1)  get_first_line_info
  2)  starts_with_paren

* Using functions in alignment_utils.

* Collapsing branches to improve readability.

* Refactoring to improve readability.
2022-10-07 08:01:03 -05:00
Jeremiah Leary bc85de813c
Updates for issue #791 (#799)
* Updates for issue #791

Adding rule procedure_call_401

  1)  Added documentation
  2)  Added test
  3)  Added rule

* Adding documentation for rule procedure_call_003.

* Fixing element name in configuration.

* Initial tests for rule procedure_call_003.

* Changing options.

* Fixing option table.

* Adding rule procedure_call_003

  1)  Added base rule multiline_procedure_call_structure
  2)  Added tests
  3)  Added rule

Fixed bug in vhdlFile.utils.find_previous_non_whitespace_token

* Removing unused functions.

* Moving identical code to common module.

* Minor formatting updates.

* Moving identical functions to fix.py

* Moving indentical functions to other modules.

* Moving indentical functions to a single module.

* Removing unused functions.

* Removing unused variables.

* Refactoring whitecase adjustment.

* Adjusting rule procedure_call_400 to include the open parenthesis.

* Removing unused imports and variables.
2022-07-29 06:48:07 -05:00
Jeremiah Leary 7225df8b9d
Updates for issue #539 (#751)
* Updates for issue #539

Adding multiline structural rule for rule signal_016.

  1)  Added test cases
  2)  Update rule signal_016
  3)  Updated documentation

* Adding test for arrays.

* Adding functions to combine slices into a single object

* Adding array_first_paren_new_line option.

* Removing unused code.

* Adding tests for the following parameter options:

  1)  array_first_paren_new_line (yes/no)
  2)  first_paren_new_line (yes/no)

* Adding documentation for configuring multiline constraint rules.

* Minor grammar updates.

* Updating per feedback:

  1)  Made symbols in table with a transparent background
  2)  Minor grammar updates
  3)  Fixed indenting in code examples

* Adding correct red penta star png file.

* Upated third example to correctly show behavior.

* Updated figure with correct indenting.
Fixed indenting in example 2.

* Adjusting indent on example 3 and example 4.

* Initial rewrite to classify constraints.

* Converting variable_declaration to call subtype_indication.classify.

* Changing constant_declaration to use subtype_indication.classify

* Changing unbounded_array_definition to use subtype_indication.classify

* Changing subtype_declaration to use subtype_indication.classify

* Changed interface_variable_declaration to call subtype_indication.classify

* Changing the following to use subtype_indication.classify:

  interface_constant_declaration
  interface_file_declaration
  interface_signal_declaration
  interface_unkown_declaration

* Changing the following to use subtype_indication.classify:

  constrained_array_definition

* Changing the following to use subtype_indication.classify

  element_subtype_definition

* Changing the following to use subtype_indication.classify:

  alias_declaration

* removing commented out line.

* Changing the following to use subtype_indication.classify:

  file_declaration

* Changing the following to use subtype_indication.classify

  access_type_definition

* Removing subtype_indication.classify_until

* Initial commit of rule signal_017

  * Implemented record_constraint_open_paren = add_new_line

* Minor refactoring.

* Extracted the following functions:

  _check_add_new_line
  _token_at_beginning_of_line

* Adding the following options to rule signal_017

  *  record_constraint_open_paren :: remove_new_line

* Adding the following options:

  record_constraint_close_paren :: add_new_line
  record_constraint_close_paren :: remove_new_line

* Adding the following options:

  record_constraint_comma :: remove_new_line

* Adding the following option:

  record_constraint_element :: add_new_line
  record_constraint_element :: remove_new_line

* Adding the following option:

  * array_constraint :: all_in_one_line

* Fixing issue with array_constraint::all_in_one_line not detecting multiline array_constraints.

* Adding the following options:

  array_constraint :: one_line_per_dimension

* Adding rule signal_400 to handle indenting of multiline signal constraints.

* Fixing issues for Codacy.

* Refactoring to reduce complexity and improve readability.

* Adding links to new rules.

* Refactoring to improve readability.

* Refactoring to improve readability.

* Fixing style issues.

* Updating for style issues.

* Updating formatting issues.

* Removing unused file.

* Removing commented out debug statements.

* Minor formatting updates.

* Adding metadata attribute and methods.

* Refactoring _check_array_contraint_one_line_per_dimension function to improve readability.

* Refactoring _check_array_constraint_all_in_one_line function to improve readability.

* Refactoring _create_violation to just take oToi as a parameter.

* Adding exception logic.

* Refactoring to improve readability.

* Refactored analyze_exception_one to improve readability.

* Refactoring the following functions:

  * _check_array_constraint_all_in_one_line
  * _check_array_constraint_one_line_per_dimension

* Refactoring the following functions:

  *  add_index_constraint_open_parenthesis
  *  add_index_constraint_close_parenthesis
  *  add_record_constraint_open_parenthesis
  *  add_record_constraint_close_parenthesis

* Refactoring to improve readability.

* Minor formatting updates.

* Adjusting signal_400 to remove extra level of indent.

* Updates for rule signal_400:

  1)  Modified base rule multiline_alignment_between_tokens to support signal_400
  2)  Added tests for the four variants of options.

* Fixing style issues.

* Simplifying _check_new_line_after_comma function.

* Deprecating rule signal_016.

* Removing unused base rule multiline_declaration_structure.

* Style and minor refactorings.

* Moving filtering of toi's from _analyze to _get_tokens_of_interest.

* Extracted update_open_paren_counter from _classify_assignment

* Extracted update_close_paren_counter form _classify_assignment

* Refactoring _fix_violation to reduce complexity

* Refactored _create_violation:

  1)  Placed violation information into oToi object

* Refactoring to reduce complexity.

* Adding rule constant_017

* Adding rule variable_017

* Updating links to rules.

* Adding rule variable_400.

* Minor cleanup of documentation.

* Adding default values for options.

* Minor updates for formatting:
2022-07-08 08:26:29 -05:00
Jeremiah Leary c203f3bc64
Updates for Issue 775 (#782)
* Updates for issue #775

Adding configurable whitespace rule:

  1)  Added preliminary documentaton
  2)  Added test
  3)  Updated whitespace rule to allow for configurations of more than one space

* Extracting functions from _analyze method.

* Adding feature to handle min and max not equal.

* Extracting function from analyze methods.

* Combined min and max values into a single option.

* Adding greater than and greater than or equal to options.

* Migrating rule entoty_007 to use whitespace_between_tokens.

* Migrating rule entity_002 to use whitespace_between_tokens.

* Migrating rule entity_011 to whitespace_between_tokens.

* Migrating rule entity_013 to whitespace_between_tokens.

* Adding link to configuring whitespace rules.

* Converting single_space_between_tokens rules to whitespace_between_tokens rules.

* Removing unused base rule single_space_between_tokens

* Refactoring single_space_between_token_pairs to extend whitespace_between_tokens.

* Adding link to individual rules.

* Renaming single_space_between_token_pairs to whitespace_between_token_pairs.

* Updating documentation.

* Refactoring single_space_after_token to extend white_space_between_tokens.

* Renaming single_space_after_token to whitespace_after_token.

* Updating documentation.

* Migrating single_space_before_token_if_on_same_line_as_token to extend whitespace_between_tokens.

* Changing name of single_space_before_token_if_on_same_line_as_token to whitespace_before_token_if_on_same_line_as_token.

* Removing unused rule.

* Removing n_spaces_after_tokens and replacing it with whitespace_after_tokens.

* Removing rule single_space_before_token.

  1)  Replaced with whitespace_before_token
  2)  whitespace_before_token now extends whitespace_between_tokens

* Refactoring whitespace_before_token rule.
Updating documentation.

* Making single_space_between_token_pairs_bounded_by_tokens extend whitespace_between_tokens.

* Refactoring to improve usability.

* Refactoring whitespace_before_tokens_in_between_tokens to improve usability.

* Formatting updates.

* Refactoring to improve readability.

* Adding [0-9][0-9]*+ as a configuration option for number_of_spaces.
2022-06-03 08:03:11 -05:00
Jeremiah Leary 267b17e72a
Updates for issue #730 (#741)
* Updates for issue #730

Adding rules to handle case for use_clause selected names.

  1)  Added new tokens to use_clause
  2)  selected names now parsed with new tokens
  3)  Added rules:
      a)  use_clause_500
      b)  use_clause_501
      c)  use_clause_502
      d)  use_clause_503
  4)  Added tests

Resolves #730

* Refactoring to reduce duplication.
Removing trailing whitespace.

* Changing exceptions to case_exceptions.

1)  case::name rules allow case_exceptions by default
2)  Updated instantiated_unit to split entity_name with a library name
3)  Rule instantiation_028 simplified
4)  Removed unused test file

* Refactoring to reduce complexity.

* Refactoring to improve readability.

* Fixed isue with procedure_506 crashing VSG due to missing variable.

* Fixing missing call to lowercase list.

* Adding the following rules:

  context_ref_500
  context_ref_501

Deprecated the following rules:

  context_ref_004

* Placing common code into a single file.

* Removing trailing whitespace.

* Refactoring to reduce the number of parameters.
2022-04-19 19:21:20 -05:00
Jeremiah Leary 0bdaf811d6
Updates to resolve #643 (#733)
* Updates for issue #643

Adding rule port_600.

* Adding rule port_601.

* Adding rule port_602.

* Refactoring to improve readability.

* Removing unused test file.

* Adding rule port_605.

* Fixing mis named function.

* Adding rule port_606.

* Adding rule port_607.

* Fixing misclassification of buffer mode type.

* Fixing misclassification of linkage port types.

* Adding rule port_603.

* Adding rules port_608 and port_609.

* Refactoring to reduce duplication.
2022-02-20 07:51:00 -06:00
Jeremiah Leary c2014549a7
Updates for issue #729 (#731)
* Updates for issue #729

Added rule ieee_500 to handle case of ieee keywords.

* Minor formatting updates.
Moved similar token classifications from name, subtype_indication and expression to utils.

* Fixing doc string.

* Deprecating rule signal_010.

* Deprecating rule signal_011.

* Deprecated rule constant_011.

* Deprecating rule variable_010.

* Removing trailing whitespace.

* Moving method to utils.

* Refactored method into function and placed it in utils.

* Refactoring to remove duplication.

* Fixing indenting.
2022-02-09 20:16:02 -06:00
Jeremiah Leary 3dd48d9464
Updates for issue #624 (#708)
* Updates for issue #624

Adding documentation for new loop rules.

* Updating another alternative output for json export.

* Temporarily reducing documentation for loop statements.

* Updating test to use correct json file for comparison.

* Adding rule loop_statement_500.

* Adding rule loop_statement_501.

* Adding rule loop_statement_502.

* Added rule loop_statement_301.

* Adding rule loop_statement_100.

* Adding rule loop_statement_101.

* Adding rule loop_statement_102.

* Refactoring base rule single_space_before_token.

* Refactoring to improve readability.
Minor formatting updates.

* Minor formatting fixes.

* Refactoring base rule single_space_after_token to improve readability.

* Refactoring to improve readability.

* Adding rule loop_statement_001.

* Added rule loop_statement_002.

* Adding rule loop_statement_003.

* Adding rule loop_statement_004
Adding rule loop_statement_201

* Adding rule loop_statement_202.

* Adding rule loop_statement_203.
Fixing documentation for rule loop_statement_201.

* Minor formatting changes.

* Moved rule for_loop_002 to loop_statement_302.
Minor grammar updates in documentation.

* Moving rule for_loop_003 to loop_statement_503.

* Clarifying documentation on rule loop_statement_503.

* Moved rule for_loop_005 to loop_statement_104:

* Refactoring to improve readability.

* Adding rule loop_statment_504.

* Adding rule loop_statement_005.

* Adding rule loop_statement_007.

* Adding rule loop_statement_006.

* Refactoring to improve readability.

* Deprecated rule while_loop_002 as it was a duplicate of rule loop_statement_302.

* Fixing solution text.

* Adding rule iteration_scheme_500.

* Adding rule iteration_scheme_501.

* Adding rule iteration_scheme_100.

* Adding rule iteration_scheme_101.

* Moved rule while_loop_001 to rule iteration_scheme_300.

* Moving rule for_loop_001 to iteration_scheme_301.

* Adding rule loop_statement_200.

* Adjusting number of tokens grabbed to fix error.
2022-02-05 06:15:47 -06:00
Jeremiah Leary 3e5648c5b4
Rule port_007 updated to check spaces before and after. (#712)
* Rule port_007 updated to check spaces before and after.

* Refactoring base rule spaces_before_and_after_tokens_when_bounded_by_tokens.

* Attempting to get test to pass.

* Fixing minor issues.

* Refactoring to improve readability.

* Refactoring to improve readability.

* Updates for code coverage:

  1)  Improved testing
  2)  Removed unused test input

* Updating rule port_008 to cover spaces before and after out keyword.

* Converting rule port_009 to check for spaces before and ader inout keyword.

* Adding updated documentation for rule port_009.

* Deprecating rule port_005.
2022-02-04 18:32:41 -06:00
Jeremiah Leary 68c8ff7241
Implementing issue #709 (#713)
* Changing rule port_map_004 to allow for moving the closing parenthesis to the same line as the last part assignment.

* Skipping JSON test as a fix was already performed on another branch.

* Removed trailing spaces.

* Converted generic_map_004 to use move_token base rule.

* Adding rule instantation_035.

* Refactoring to improve readability.

* Updating documentation.

* Updated rule generic_010 to allow for parenthesis to be on same line or next line.
Added rule generic_021 to enforce semicolon next to closing parenthesis.

* Refactoring to improve readability.

* Updating rule port_014 to allow for moving the closing parenthesis to the previous line.
Adding rule port_027 to force semicolon to be next to closing parenthesis.
2022-02-04 18:25:10 -06:00
Jeremiah Leary 41b0a3704f
Updates for Issue 705 (#717)
* Updates for issues #655 and #707:

VSG would lockup if an error was encountered during classification.

  1)  Exception added to print_error_message to report classification errors.
  2)  Exception is caught in apply_rules.py and handled so it does not lock up the multiprocessing pool.

* Updates for issue #705:

Changing rule constant_014 to include align_left and align_parent options.

* Refactoring to reduce duplication.

* Changing options for constant_012 from boolean to strings to align with similar rules.
2022-02-03 18:55:58 -06:00
Jeremiah Leary a18fe76779
Issue 575 (#703)
* Update for issue #575:

Fixing alignment rules as they were introducing syntax errors:
  align_tokens_in_region_between_tokens
  align_tokens_in_region_between_tokens_skiping_lines_starting_with_tokens

* Refactoring to improve readability.

* Addressing issues from Codacy and Codeclimate

* Refactoring number_of_tokens_in_token_list to improve readability.

* Refactoring utils functions to improve readability.

* Removing unused variable.

* An exit statement with a <= was being classified as a signal assignment.

* Fixed issue with improper classification of character literals.

* Extracting class from tokens.py

* Refactoring tokens.py to improve readability.

* Fixing issue when attempting to detect trailing whitespace.

* Updating tests to reflect changes in tokens.py

* Refactoring combine_characters_into_words to improve readability.

* Refactoring combine_string_literals to improve readability.

* Refactoring find_indexes_of_double_quote_pairs to improve readability.

* Refactoring combine_character_literals to improve readability.

* Refactoring to improve readability.

* Removing unused functions.

* Adding additional tests for tokenizer.

* Moving rule variable_assignment_004 to phase 5 and subphase 2 to ensure it runs correctly.

* Updating documentation for variable_assignment_004 change in phase.

* Rule constant_012 was operating on constant which were not arrays.

* Removing unused function.

* Removing unused function.

* Moving rule generic_001 to entity_200 to properly handle generic_clause in a package declaration.

* Refactoring extract routines to improve readability.

* Refactoring base rule to improve readability.

* Fixing Minor formatting issues.

* Removing unused function.

* Removing unused functions.

* Improving code coverage.

* Improving code coverage:

  1)  Removed unused functions
  2)  Removed unreachable code

* Refactoring constant_012 to improve readability.

* Refactoring analyze to _analyze:

  1)  Updated _get_tokens_of_interest to add more info into the token object

* Refactoring to improve readability.

* Refactoring generate_paren_dicts function to improve readability.

* Refactoring check_indents to improve readability.

* Refactoring to improve readability.

* Updates for rule constant_012:

  1)  Arguments align_left False and align_paren True working

* Refactored analyze_align_left_true_align_paren_false function in rule constant_012

* Refactored _analyze_align_paren_true_align_left_true function for rule constant_012.

* Removed unused functions and methods for rule constant_012.

* Updated rule constant_012 to use the indent step

* Refactoring to functions into methods.

* Removing unused file.

* Refactoring rule constant_012 to improve readability.

* Additional refactoring to improve readability.

* Refactoring check_left_aligned_line function to use less parameters.

* Removing unused variables.

* Attempting to get JSON extract test to pass on CI server.

* Removing unused functions.

* Updates for rule comment_100:

  Rule was error out if a comment was only 3 characters and the third was not a letter or number.

    1) Updated test
    2) Added check for length of comment

* Updates for parsing procedure_calls_statements:

Procedure call with <= was being classified as a simple waveform.

  1)  Updated test to expose issue
  2)  Updated classification code

* Refactoring to reduce cyclomatic complexity.

* Refactoring to reduce cyclomatic complexity.

* Minor formatting updates.

* Adding parsing of physical_type_definitions:

  1)  Added tokens
      a)  physical_type_definition
      b)  primary_unit_declaration
      c)  secondary_unit_declaration
  2)  Added classifiers
      a)  physical_type_definition
      b)  primary_unit_declaration
      c)  secondary_unit_declaration
  3)  Added test
      a)  full_type_declaration

* Minor formatting fix.

* Fixed bug with concurrent_simple_signal_assignment.

  A <= in a generic map was causing the generic map to be classified as a concurrent_simple_signal_assignment.

  1)  Updated test
  2)  Updated concurrent_simple_signal_assignment classifier

* Refactoring to reduce cyclomatic complexity.

* Adding classification of configuration_specification:

  1)  Added tests
  2)  Added classifiers for configuration_specification.

* Minor formatting updates.

* Fixing issue with previous_line rule if there were no lines above.

* Assert_statement was being classified before exiting block_statement.

* A backslash in a string literal was not be classified as a string literal.
2022-01-22 19:01:08 -06:00
Jeremiah Leary 9dbbd62004
Updates for issue #684 (#693)
* Updates for issue #684

Rule entity_019 was inserting an extra space when not needed.

  1)  Updated test to expose the issue
  2)  Updated code to fix the issue

* Updates for issue #684

Refactoring to improve readability.

* Updates for issue #684

Fixing function get_number_of_carriage_returns_before_token to stop after finding stop token.

* Updates for issue #684

Found corner case for rule instantiation_033 where the component keyword was misplaced when adding it.

  1)  Updated tests
  2)  Updated rule to fix issue

* Updates for issue #684

Updating rules entity_015, package_007 and context_021 to properly handle spaces.

  1)  Updated test for entity_015
  2)  Updated base rule insert_token_right_of_token_if_it_does_not_exist_before_token

* Updates for issue #684

Updating rule package_body_002 to handle spaces before the semicolon.

  1)  Updated tests
  2)  Updated base rule insert_tokens_right_of_token_if_it_does_not_exist_before_token

* Updates for issue #684

Updated rules architecture_010 and component_021 to properly handle spaces.

  1)  Updated tests
  2)  Changed base rule

* Updates for issue #684

Updating rules block_002 and process_012 to properly handle spaces.

  1)  Updated tests
  2)  Updated base rule insert_token_right_of_possible_tokens_if_it_does_not_exist_before_token

* Updates for issue #684

Fixing minor issues for Codacy.
2021-12-12 09:48:19 -06:00
Jeremiah Leary bec4264ac1 Updates for issue #597
Fixing issue with assigning indents for lines that were not assigned indents.

  1)  Updated documentation
  2)  Updated tests
  3)  Assigning indent to lines which were not assigned indents before
2021-09-18 10:07:27 -05:00
Jeremiah Leary 1f5b06935e Updates for issue #573
Adding option move_last_comment for rule constant_016:

  1)  Updated documentation
  2)  Added tests
  3)  Updated rule constant_016
  4)  Fixed get_tokens_bounded_by extract function
2021-05-04 17:10:54 -05:00
Jeremiah Leary ab405f726f Updates for issue #573
Fixing losing of code tags when inserting tokens.
2021-05-01 16:09:21 -05:00
Jeremiah Leary be053bfc4d Updates for issue #541
Adding rule comment_011 to move inline comments to line above.

  1)  Added documentation
  2)  Added tests
  3)  Added rule comment_011
  4)  Moved functions to vsg/rules/utils.py
  5)  Added new extractor
2021-03-23 22:31:40 -05:00
Jeremiah Leary a70523bda4 Updates for issue #450:
Adding option assign_on_single_line.

  1)  Updated documentation
  2)  Added tests
  3)  Added option to rule constant_016
2021-02-22 17:22:47 -06:00
Jeremiah Leary 46b7a30a70 Updates for issue #450:
Fixing line violation reporting.

  1)  Updated options so they report the correct line number of the violation.
2021-02-22 17:22:47 -06:00
Jeremiah Leary 5e4000dc83 Updates for issue #450:
Adding first attempt at detecting first_paren_new_line option.
Fixing still needs to be implemented.
2021-02-22 17:22:47 -06:00
Jeremiah Leary 5a959acb17 Updates for issue #456
Adding ability to add or remove optional keywords.

  1)  Updated base rules to allow for removal of keywords
  2)  Changed default of instantiation_033 to add the keyword
  3)  Updated tests
  4)  Updated documentation
2020-12-12 10:49:44 -06:00