Commit Graph

3217 Commits

Author SHA1 Message Date
Benjamin Thiemann 068f9102ef
Issue#1451: Fixed array detection and parenthesis handling in multiline_alignment_between_tokens (#1468)
* Issue#1451: Fixed array detection in multiline_alignment_between_tokens

* Move function toi_is_array from multiline_simple_structure to the 
  utils module and use this function in 
  multiline_alignment_between_tokens, because it correctly classifies
  parenthesis of aggregates. The previous function there falsely 
  triggered array detection on parenthesis around logical operators.

* Rename "check_for_array" to "skip_array", because that is what the 
  variable is used to do.

* Extend tests for concurrent_003 with logical expressions that start 
  with a parenthesis.

* Issue#1451: Fixed parenthesis handling in multiline_alignment_between_tokens

Do not add parenthesis pairs to the list of occurring parenthesis if
they are on the same line.
2025-09-02 21:18:33 -05:00
Jeremiah Leary a73054725f Fixing test failure on documentation. 2025-09-01 12:56:40 -05:00
Rui Chen 5fa097a564
fix SyntaxWarning for py3.13 compatibility (#1441)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2025-09-01 10:01:30 -05:00
Jeremiah Leary 043ee7a0f9
Issue#1413: Fixing incorrect reference to rule in documentation. (#1414) 2025-09-01 09:51:24 -05:00
JFMarten 7a7ad605b4
issue-1469: warning for no matches of file_rules (#1470)
Co-authored-by: Jakob Marten <github@jfmarten.de>
2025-07-19 14:25:39 -05:00
Lincoln Lorenz c786afbd67
Issue#1471: UTF-8 check should handle output differences from command (#1472)
* Issue#1471: UTF-8 check should handle output differences from  command

* Use native encoding checks to validate fix preserves file encodings

* Mocking stdout to keep stdout from displaying during tests.

* Fixing style issues.

---------

Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com>
2025-07-19 14:09:53 -05:00
Benjamin Thiemann 587052b276
Fix file_rules globbing (#1453)
* Issue#1446: Fixed comment indentation at end of scope

* config: Refactored glob_filenames

* config: Fixed error message construction in validate_file_exists

* config: Fixed process_file_list_key to use key parameter

* Issue#1425: Fixed missing globbing of "file_rules"

* Adding tests.

* Revert "Issue#1446: Fixed comment indentation at end of scope"

This reverts commit 7106e12fd05049924ea89447922b00de0c83c7fc.

---------

Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com>
2025-07-13 14:25:44 -05:00
Jukka Hertzog e02087dc8f
Issue#1250: Corrected alignment of multiline variable and signal declarations for align_left = no (#1345)
* Issue#1250: Corrections to multiline_alignment for method _analyze_align_left_no_align_paren_yes.

* Issue#1250: Updated tests after corrections to multiline_alignment for method _analyze_align_left_no_align_paren_yes.

* Issue#1250: Updates after merge of issue-1290.

* Issue#1250: Updated "align_left no, align_paren no" alignment as well.

* Issue#1250: Updated tests for signal_400.

* Issue#1250: Updated tests for variable_400.

* Issue#1250: Formatting.
2025-07-11 06:23:26 -05:00
Jeremiah Leary 285768d3eb
Fixing warnings during doc generation. (#1465)
* Fixing warnings during doc generation.

* Fixing style issues.
2025-07-10 21:49:37 -05:00
Benjamin Thiemann bd8541b702
Fix missing carriage return handling for rules moving token to previous line (#1455) 2025-07-10 14:00:56 -05:00
Jeremiah Leary a595084ffa
Issue#1403: VSG crashes in constaint due to not checking for "is" or ">>". (#1405) 2025-07-10 07:47:38 -05:00
malsheimer 4cb3be55f5
add new rule_015 for variables (#1440)
This rule checks for multiple (shared) variable names defined in a single (shared) variable declaration.
By default, this rule will only flag more than two (shared) variable declarations.
2025-07-10 07:07:58 -05:00
malsheimer 6a68806d9e
Add new rule variable_500 to check case of keyword "shared" (#1464) 2025-07-08 19:43:04 -05:00
Jukka Hertzog c3b9b537a9
Issue#1459: Added architecture specification enforcement for entity instantiations (#1460)
* Issue#1459: Added rule instantiation_036.

* Issue#1459: Added tests for rule instantiation_036.

* Issue#1459: Added docs for rule instantiation_036.

* Issue#1459: Test change to trigger CI run.

* Revert "Issue#1459: Test change to trigger CI run."

This reverts commit d983807ceadb9c6b942ea60f327dce28fc96b485.

* Issue#1459: Changed default behaviour to "add".
2025-07-06 16:44:10 -05:00
Benjamin Thiemann 78cd5ec485
Fix comment indentation at end of scope (#1452)
* Issue#1446: Fixed comment indentation at end of scope

* Refactored implementation:

  1)  Removed pragma updates
  2)  Added options to configure
      a)  Declarative part can be configured independent of statement part
  3)  Added documentation
  4)  Updated tests for all combinations of configurations

* Fixing configuration merge of indent options.

* Minor updates to error reporting.

* Updating failing tests.

---------

Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com>
2025-07-06 15:12:10 -05:00
Jeremiah Leary a6e745c809
Issue#1442: Ensuring ISO-8859 encoded files are written as ISO-8859 encoded files (#1463)
* Issue#1442:  Ensuring ISO-8859 encoded files are written as ISO-8859 encoded files.

* Attempting to get builds to pass.

* Attempting to update build tool versions.

* Updating license to current standard.

* Disabling manifest to debug github action errors.

* Switching out pytest for unittest

* Adding __init__.py file so file_encodings test runs

* Attempting to skip failing tests.

* Attempting to skip tests during GITHub actions.

* Adding debug prints.

* Printing out environment variables to help with debug.

* Using HOME environment variable to test for GITHUB.

* Removing debug print statements.

* Enabling pytest.

* Replacing pytest with unittest.

Pytest is failing on some plugin and I do not know how to fix it.
2025-07-04 14:10:49 -05:00
Jeremiah Leary 4c0120a5a4
Issue#1415: Fixing classification of + and - when used with predefined attributes. (#1417) 2025-06-29 11:59:49 -05:00
Jeremiah Leary 78b7cf3bb6
Issue#1433: Fixed mis-classification of signs. (#1434) 2025-04-06 16:52:26 -05:00
Pelle Eikeberg aecb5f63b9
Issue#1427: added 'r' to string to allow to invalid escape char 2025-03-25 07:10:36 -05:00
Jeremiah Leary bf5057891c
Issue#1420: Delimited comment tokens were not classified correctly. (#1422) 2025-03-18 19:33:09 -05:00
Jeremiah Leary 3d58538005
Issue#1411: Adding parsing for PSL. (#1412)
* Issue#1411:  Adding parsing for PSL.

* Fixing cover_assertion classification.
2025-03-12 07:22:48 -05:00
Jeremiah Leary c5184bf694
Issue#1409: Fixing crash with rules architecture_600 and architecture_601. (#1410) 2025-03-09 10:33:10 -05:00
Jeremiah Leary 399ef06989
Issue#1407: Timestamp preserved for unmodified files. (#1408)
* Issue#1407:  Timestamp preserved for unmodified files.

* Removing debug print statement.
2025-03-08 07:58:30 -06:00
Jeremiah Leary 54405d9e8e
Issue 1402 (#1406)
* Issue#1402: Adding rule interface_incomplete_type_declaration_500

* Adding rule interface_incomplete_type_declaration_501.

* Adding rule interface_incomplete_type_declaration_600.

* Adding rule interface_incomplete_type_declaration_601.

* Fixing style issues.
2025-03-06 06:02:15 -06:00
Jeremiah Leary d6422f774d
Issue#1358: Adding user_error_message option. (#1387) 2025-03-02 12:14:53 -06:00
Jukka Hertzog cc678cb21f
Issue#1383: Added case rules for file declarations (#1396)
* Issue#1383: Added case rules for file declarations.

* Issue#1383: Added tests for case rules for file declarations.

* Issue#1383: Added documentation for case rules for file declarations.

* Issue#1383: Added case rules for file type declarations.

* Issue#1383: Added tests for case rules for file type declarations.

* Issue#1383: Added documentation for case rules for file type declarations.

* Issue#1383: Corrected "file type declaration" to "file type definition".
2025-01-19 17:18:53 -06:00
Jukka Hertzog 12473270ea
Issue#1389: Whitespace rules for case-generate statements (#1390)
* Issue#1389: Expanded on case rules to check that they don't affect case-generates.

* Issue#1389: Added new case generate rules.

* Issue#1389: Added tests for new case generate rules.

* Issue#1389: Added documentation for new case generate rules.

* Issue#1389: Corrected test file reference.

* Issue#1389: Corrected code snippet.

* Issue#1389: Corrected code snippet.

* Issue#1389: Connected code snippets

* Issue#1389: Corrected code snippet.

* Issue#1389: Corrected code snippet

* Issue#1389: Updated rules to use simpler base rules where possible.

* Issue#1389: Updated rules to use simpler base rules where possible.

* Issue#1389: Corrected mistake in case_004.
2025-01-19 16:45:26 -06:00
Jukka Hertzog 009cb1b0e0
Issue#1394: Removed unreachable return statement (#1395) 2025-01-19 16:41:04 -06:00
Jeremiah Leary 8e16b801d6 Adding python 3.13 to github build action. 2025-01-18 07:59:58 -06:00
Jukka Hertzog 286d592642
Issue#1392: Minor formatting fix in `case_300` documentation. (#1393)
* Issue#1392: Updated docstring for case_300

* Issue#1392: Updated docs for case_300
2025-01-18 06:53:37 -06:00
Jeremiah Leary 431504ecbc Fixing style issues. 2025-01-13 21:38:34 -06:00
Brandon Maier 4b43d5744a
Fix for pytest on Windows (#1338)
* tests: support admin check on Windows

The tests fail on Windows with the following

> ___________ ERROR collecting tests/source_file/test_source_file.py ____________
> tests\source_file\test_source_file.py:24: in <module>
>     class testOSError(unittest.TestCase):
> tests\source_file\test_source_file.py:39: in testOSError
>     @unittest.skipIf("SUDO_UID" in os.environ.keys() or os.geteuid() == 0, "We are root. Root always has permissions so test will fail.")
> E   AttributeError: module 'os' has no attribute 'geteuid'

Catch the AttributeError and attempt to check for admin when on Windows

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>

* tests: support running 'vsg' binary on Windows

A large number of tests fail on Windows with the following error

> ________ test_severity_using_main.test_architecture_with_configuration ________
> [gw0] win32 -- Python 3.8.20 %PREFIX%\python.exe
>
> self = <tests.severity.test_main.test_severity_using_main testMethod=test_architecture_with_configuration>
>
>     def test_architecture_with_configuration(self):
>         try:
> >           subprocess.check_output(["bin/vsg", "-f", self._sArchitectureFileName, "-c", sConfigFile])
>
> tests\severity\test_main.py:86:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ..\_test_env\lib\subprocess.py:415: in check_output
>     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
> ..\_test_env\lib\subprocess.py:493: in run
>     with Popen(*popenargs, **kwargs) as process:
> ..\_test_env\lib\subprocess.py:858: in __init__
>     self._execute_child(args, executable, preexec_fn, close_fds,
...
> E FileNotFoundError: [WinError 2] The system cannot find the file specified
> ..\_test_env\lib\subprocess.py:1327: FileNotFoundError

Tests that call "bin/vsg" are relying on the Unix shebang (e.g.
"#!/usr/bin/python") to launch `vsg` using the Python interpreter, But
this is not supported on Windows. Instead launch `vsg` with Python
directly.

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>

* tests: normalize line endings for Windows tests

Many of the tests that compare `vsg` stdout fail with a warning as
follows.

> First differing element 0:
> 'ERRO[19 chars]1.vhd(7)port_007 -- Change number of spaces after *in* to 4.\r'
> 'ERRO[19 chars]1.vhd(7)port_007 -- Change number of spaces after *in* to 4.'

The tests use `.split('\n')` to split stdout and stderr by the Linux
line terminator '\n'. But on Windows this causes test failures as the
line terminator is '\r\n'.

Instead use Python `.splitlines()`. which will split on both Linux and
Windows style line terminators. `.splitlines()` also removes empty
trailing lines, so we must modify the expected output accordingly.

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>

* Fixing test error by including encoding when reading vhdl files.

* Fixing second error due to glob function using incorrect divider.

* Fixed file compare not working in quality report test.

* Fixed output error message to be independent of platform.

* Skipping permission tests when running on windows.

* Skipping file permission test when running on Windows.

---------

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>
Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com>
2025-01-13 20:46:16 -06:00
Jeremiah Leary d34592f34b
Merge pull request #1203 from jeremiah-c-leary/issue-1202
Issue#1202:  Adding Pascal_Snake_Case option to case rules.
2025-01-13 06:51:12 -06:00
Jeremiah Leary ec4910cd0f
Merge pull request #1388 from valerionew/patch-1
Update tox.ini to include python 3.13
2025-01-12 09:17:15 -06:00
Valerio 28ff282b79
Update tox.ini to include python 3.13 2025-01-07 11:35:27 +01:00
Jeremiah Leary 267e02b25b
Merge pull request #1386 from JHertz5/issue-1385
Issue#1385: Replace rules iteration_scheme_502 and for_generate_statement_502 with a parameter_specification rule
2025-01-05 08:43:34 -06:00
Jukka Hertzog 17720811ad
Merge branch 'jeremiah-c-leary:master' into issue-1385 2025-01-04 21:12:17 +00:00
JHertz5 c01ece36d3 Issue#1385: Documentation correction for deprecated rules. 2025-01-04 21:09:49 +00:00
Jeremiah Leary d3f6e80124
Merge pull request #1380 from JHertz5/issue-1366
Issue#1366: Added structure rules for subprogram instantiation declarations
2025-01-04 13:58:44 -06:00
JHertz5 1d63871e75 Merge remote-tracking branch 'origin/master' into issue-1366 2025-01-04 18:47:29 +00:00
Jukka Hertzog 756fd22e49
Merge branch 'jeremiah-c-leary:master' into issue-1385 2025-01-04 18:45:46 +00:00
Jeremiah Leary a79da927c9
Merge pull request #1381 from JHertz5/issue-1318
Issue#1318: Added whitespace rules for subprogram instantiation declarations
2025-01-04 12:23:08 -06:00
JHertz5 9727a04330 Issue#1385: Updated documentation. 2025-01-04 17:41:24 +00:00
JHertz5 447158529d Issue#1385: Deprecated rules iteration_scheme_502 and for_generate_statement_502. 2025-01-04 17:39:03 +00:00
JHertz5 ca3f0b93bf Issue#1385: Added tests for case rule for in keyword in parameter specifications. 2025-01-04 17:37:42 +00:00
JHertz5 9fcb0ee003 Issue#1385: Added case rule for in keyword in parameter specifications. 2025-01-04 17:29:30 +00:00
Jukka Hertzog d1f1cce68a
Merge branch 'jeremiah-c-leary:master' into issue-1318 2025-01-04 17:18:17 +00:00
Jukka Hertzog d53cf5ee1e
Merge branch 'jeremiah-c-leary:master' into issue-1366 2025-01-04 17:17:39 +00:00
Jeremiah Leary 71705a6fb9
Merge pull request #1382 from JHertz5/issue-1376
Issue#1376: Added case rules for parameter identifiers in for generates/loops
2025-01-04 11:01:39 -06:00
Jeremiah Leary 83a6e68f03 Updating documentation for upper and lower case configuration. 2025-01-04 10:31:45 -06:00