Commit Graph

39 Commits

Author SHA1 Message Date
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 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 f8f5f77c58
Updates for issue #651 (#662)
* Updates for issue #651

Initial attempt at adding rule groups.

  1)  Updated documentation
  2)  Added indent group
  3)  Added tests

* Addressing CodeClimate issues.

* Additional code climate updates.

* Renaming depricated to deprecated.

Adding tests to improve code coverage.

* Adding length group and updating documentation.

* Adding indent labels to rule documentation.

* Adding blank_line group.

* Minor documentation update.

* Adding more rules to the blank_line group.

* Adding blank_line label to blank line rules in documentation.

* Adding whitespace rule group

* Adding case group.

* Adding structure rule group:

  1)  Addings structure rule group object
  2)  Updated base rules which should utilize the rule group

* Adding more base rules to the whitespace rule group.

* Adding more base rules to the case rule group.

* Adding naming rule group:

  1)  Added naming rule group
  2)  Assigned base rules to the naming rule group

* Adding alignment rule group:

  1)  Added alignment rule group
  2)  Added base rules to alignment rule group

* Assigning more rules to rule groups.

* Adding last rule to a rule group.
Fixing error introduced into whitespace_001

* Assigning sub groups to architecture rules.

* Updating after rules documentation to add rule group.

* Adding rule group to assert rule documentation

* Updating attribute_declaration rules rule group.

* Adding program to generate rule documentation:

  1)  Added bin/vsg_rule_doc_gen
  2)  Added tests
  3)  Copied existing documentation into rule doc strings for the following rule classes:
      a)  after
      b)  architecture
      c)  assert_statement
      d)  attribute
      e)  attribute_declaration
      f)  attribute_specification
      g)  block
  4)  Partially update deprecated rules to they could be processed

* Converting block_comment documentation.

* Converting case_rule documentation.

* Converting comment rule documentation.

* Converting component documentation to doc strings.

* Converting concurrent rule documentation to doc strings.

* Convert constant docs to doc strings.

* Converting context rule doc to doc strings.

* Fixing failing tests.

* Converting context reference doc to doc strings.

* Converting entity doc rules to doc strings.

* Converting entity_specification rule doc to doc strings.

* Converting exit_statement rule doc to doc strings.

* Converting file_statement rule docs into doc strings.

* Converting for_loop rule doc to doc strings.

* Converting function rule doc to doc strings.

* Converting generate rules doc to doc strings.

* Converting generic rule doc to doc strings.

* Converting generic_map rule doc to doc strings.

* Converting if rule docs to doc strings.

* Converting instantiation rule doc to doc strings.

* Converting length rule doc to doc strings.

* Converting library rule doc to doc strings.

* Convert loop_statement rule doc to doc strings.

* Converting package rule docs to doc strings.

* Converting package_body rule doc to doc strings.

* Converting port rule doc to doc strings.

* Converting port_map rules doc to doc strings.

* Converting procedure rule doc to doc strings.

* Converting procedure_call rule doc to doc strings.

* Converting process rule doc to doc strings.

* Converting range rule doc to doc strings.

* Converting report_statement rule doc to doc strings.

* Converting sequential rule doc to doc strings.

* Converting signal rule doc to doc strings.

* Converting source_file rule doc to doc strings.

* Converting subprogram_body rule doc to doc strings.

* Converting subtype rule doc to doc strings.

* Converting type rule doc to doc strings.

* Converting variable rule doc to doc strings.

* Converting variable_assignment rule doc to doc strings.

* Converting wait rule doc to doc strings.

* Converting when rule doc to doc strings.

* Converting while_loop rule doc to doc strings.

* Converting whitespace rule doc to doc strings.

* Converting with rule doc to doc strings.

* Fixing tests due to further refinements of rule groups.

* Removing generated doc files after tests.

* Updating documentation to include rule group information.

* Removing trailing whitespace.

* Minor formatting fixes for documentation.

* Fixing issues for codacy.

* Skipping currently failing tests so I can address coding issues.

* Removing unused libraries.

* Minor formatting issues resolved.

* WIP:  Setting desired test input.

NOTE:  tests fail as I need to implement fixes.

* Improving testing of rule groups.

* Enhancing test so it will pass.

* Updates for codacy.
2022-01-01 17:46:43 -06:00
Jeremiah Leary 389a731ae0 Updates for issue #560
Adding depricated rules.

  1)  Updated documentation to provide links to new rules
  2)  Added tests for depricated rules
  3)  Added rules that were depricated back to rule set using the depricated rule class
2021-05-08 07:56:51 -05:00
imd 14a0dbe633 variable suffix rule 2021-05-01 21:46:11 +01:00
Emil Vanherp a158fd2ac9
Distinguish between file errors
* Don't exit on file not found or other OSErrors, but continue (revert
from fc34afd4d0339e0b17d8f46e3bf527461beccf1a)
* Empty file, file not found, no permission and other
OSErrors are now reported differently.
2021-01-22 15:21:41 +01:00
Emil Vanherp 0971ca194c
Move read_vhdlfile to vhdlFile/utils
And exit with exit code 1 on file not found or any other OSError
2021-01-22 15:21:41 +01:00
Emil Vanherp 73420cdca2
remove trailing whitespace 2021-01-11 21:55:56 +01:00
Jeremiah Leary be88d4a462 Updates for issue #445
Adding ability for the user to adjust the indenting algorithm.

  1)  Added documentation
  2)  Refactored indent algorithm
      a)  Changed algorithm to use a YAML configuration file
  3)  Added indent dictionary to -oc output
  4)  Updated tests to use new YAML configuration file
2020-12-20 18:06:07 -06:00
Jeremiah Leary 2d672df79d Major refactor to remove the use of line.py to improve performance. 2020-11-09 20:49:45 -06:00
Jeremiah Leary dca6ed4dbb Refactoring additional variable and signal rules for new parser. 2020-10-24 09:48:58 -05:00
Jeremiah Leary f95fa99028 Refactoring additional variable rules for new parser. 2020-10-24 09:21:23 -05:00
Jeremiah Leary 6e04be1bc9 Refactoring variable rules for new parser. 2020-10-18 14:06:57 -05:00
Jeremiah Leary a95bd04873 Replacing older parser with newer one:
1)  Called out parsers from classify_new instead of classify
  2)  Updated invalid test inputs
  3)  Updated test results
  4)  Removed unused files
2020-09-19 07:46:35 -05:00
Jeremiah Leary 05889e8176 Adding component declaration objects and refactored parser.variable objects into token.variable_declaration objects. 2020-08-07 07:21:54 -05:00
Jeremiah Leary 16e8c1cb27 Adding variable declaration objects. 2020-08-01 16:48:03 -05:00
Jeremiah Leary 7a3fcf9883 Updates for issue #434:
Adding rules to align declaration identifiers:

  1)  Updated documentation
  2)  Removed the following rules
      file_003, constant_003, attribute_003, signal_003, subtype_003, type_003 and variable_003
  3)  Added new rules:
      architecture_029, function_015, package_019, procedure_010 and process_037
  4)  Added tests for new rules
  5)  Updated classifiers to support new rules
2020-06-30 11:36:01 -05:00
Jeremiah Leary de942890b3 Updates for issue #385:
The rule process_031 was attempting to align variables defined in function and procedures with variables outside functions and procedures in the process declarative region.

  1)  Updated tests to expose issue
  2)  Fixed to make tests pass

Additional issue found with handling indents on processes with just 'process is' when updating tests.

  1)  Fixed code to make tests pass
2020-05-09 09:12:19 -05:00
Jeremiah C Leary b9abdf8a57 Updates for issue #362:
Updated rules to use consistent violation dictionary:

  1)  Updated check.indent_of_comments_above to use the violation dictionary
  2)  Updated rules to use the violation dictionary
  3)  Updated tests
2020-03-31 20:09:51 -05:00
Jeremiah C Leary 7d85a98db4 Updates for issue #362:
Interim commit to move all rules to new violation dictionary format.
2020-03-29 13:09:38 -05:00
Michał Kruszewski 2f08a64bda Refactor keyword alignment rules. 2020-02-24 21:14:44 +01:00
Jeremiah C Leary cd43aabb42 Updates for issue #335
Updated variable rules to use violation dictionary for violation list.

  1)  Updated code
  2)  Updated tests
2020-02-16 21:58:58 -06:00
Jeremiah C Leary ddc32f8ed9 Updates for issue #335:
Updated tests using the indent base rule to use dictionaries for the violation list.

  1)  Updated code
  2)  Updated tests
2020-02-16 08:27:55 -06:00
Jeremiah C Leary aca83b6b03 Updates for issue #335
Updated rules using the single_space_before_character_rule to use dictionaries in the violation attribute.

  1)  Updated tests
  2)  Updated code
2020-02-15 19:13:40 -06:00
Jeremiah C Leary 2dc372a6f4 Updates for issue #335
Updated rules using is_single_space_after_character_rule to use dictionaries for entries in the violation list.

  1)  Updated tests
  2)  Updated code
2020-02-15 18:58:47 -06:00
Jeremiah C Leary fdcdf2d909 Updates issue #335:
Updated rules using vsg.check.has_prefix to use the violations list in the fix phase:

  1)  Updated tests
  2)  Updated vsg.check.has_prefix to push a dictionary into the violation list
2020-02-15 16:25:59 -06:00
Jeremiah C Leary fb4c5ca972 Updates for issue #335:
Updated rules based on the single_space_after_rule and multiple_spaces_after_rule base rules:

  1)  Updated rules to use violations list for the fix phase
  2)  Updated tests
2020-02-15 16:12:47 -06:00
Michał Kruszewski 7666fae485 Make case_rule to use violations attribute for fixing errors. 2020-02-15 16:51:01 +01:00
Jeremiah C Leary 2b2c66bc37 Adding tests to improve code coverage. 2019-10-18 06:20:25 -05:00
Jeremiah C Leary 08e3680b70 Updates for Codacy:
1)  Removed trailing whitespace
  2)  Removed unused general tests
2019-03-31 10:03:00 -05:00
Jeremiah C Leary aae2fc9a4e Updates for issue #224
Adding case consistency checks for variable names:

  1)  Added documentation
  2)  Added tests
  3)  Added rule variable_011
2019-03-31 09:54:08 -05:00
Jeremiah C Leary c314cd0430 Updates for issue #224
1)  Added general_001 to look for inconsistent capitalization
      a)  Added tests
  2)  Updated variable_010 to ignore everything after the "range" in a variable definition
      a)  Updated tests
2019-03-27 22:42:58 -05:00
Jeremiah C Leary 1948b70444 Updates for Codacy issues:
Removing trialing whitespaces.
2019-03-10 12:19:16 -05:00
Jeremiah C Leary 183b9f5c18 Updates for issue #193
The class vhdlFile now takes a list instead of a file name.
This removes the responsibility of reading the file from the vhdlFile class.
Which allows for better integration into other tools.
2019-02-24 12:49:25 -06:00
Jeremiah C Leary b71322773e Updates for issue #192
Removing rule variable_011 because it was obsoleted by process_031

  1)  Updated documentation
  2)  Updated tests
  3)  Removed rule variable_011
2018-12-17 21:16:16 -06:00
Jeremiah C Leary 5d1881a153 Updates for issue #187
Fixed variable : alignments so process variables are not aligned between processes or with variables in the architecture declarative region.

  1)  Restricted variable_009 to only operate in the architecture declarative region
  2)  Added variable_011 to align :'s in processes
  3)  Added/Updated tests
  4)  Added and updated documentation
2018-12-12 10:28:34 -06:00
Jeremiah C Leary cf504ee53e Updates for issue #43:
1)  Added fixes for variable rules
2017-11-22 12:41:59 -06:00
Jeremiah C Leary 12a585171c Updates for issue #52:
1)  Fixed easy code coverage issues.
2017-11-22 06:45:06 -06:00
Jeremiah C Leary c3dc407048 Updates for variable rules:
1)  Adding variable rules
2017-11-05 14:09:03 -06:00