-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add linesep configuration option Platform independent line ends are important to avoid conflicts. Resolves: #1010 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> * Perform atomic write to files Do not overwrite file as we may corrupt the file if something fails, instead write into temporary location and move the result into the final destination. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> * Synchronize README command-line usage Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> * Support files as positional argument Tools such as pre-commit and other tools expects the tools to accept the input files as positional argument and not as options. Let's support the two variants. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> * Support shallow git clone without tags pre-commit uses shallow clone without tags, as this is not used to publish the artifact, let's assume version '0' in this case. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> * Add pre-commit hooks support Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> --------- Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
- Loading branch information
Showing
17 changed files
with
190 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- id: vsg | ||
name: fix VHDL style | ||
description: VHDL Style Guide | ||
entry: vsg --fix --jobs=1 | ||
language: python | ||
types: | ||
- file | ||
files: \.(vhd|vhdl)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/tool_integration.rst → docs/tool_integration/generic.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pre-commit Integration | ||
---------------------- | ||
|
||
VSG supports integration with pre-commit using the following ``.pre-commit-config.yaml`` file: | ||
|
||
.. code-block:: yaml | ||
repos: | ||
- repo: https://github.com/jeremiah-c-leary/vhdl-style-guide | ||
rev: v3.18.0 | ||
hooks: | ||
- id: vsg | ||
You may customize VSG by using the ``arg`` node, for example: | ||
|
||
.. code-block:: yaml | ||
repos: | ||
- repo: https://github.com/alonbl/vhdl-style-guide | ||
rev: v3.18.0 | ||
hooks: | ||
- id: vsg | ||
args: | ||
- --configuration=.vsg.yaml | ||
- --output_format=syntastic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Tool Integration | ||
------------------ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
generic.rst | ||
pre-commit.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-------------------------------------------------------------------------------- | ||
0 | | ||
-------------------------------------------------------------------------------- | ||
1 | -- ANSI "" comment | ||
<class 'vsg.parser.comment'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- ANSI "���" comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
import unittest | ||
|
||
from vsg.tests import utils | ||
from vsg import vhdlFile | ||
|
||
sLrmUnit = utils.extract_lrm_unit_name(__name__) | ||
|
||
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(os.path.dirname(__file__), sLrmUnit,'classification_test_input.vhd')) | ||
oFile = vhdlFile.vhdlFile(lFile) | ||
|
||
|
||
class test_token(unittest.TestCase): | ||
|
||
def test_classification(self): | ||
sTestDir = os.path.join(os.path.dirname(__file__), sLrmUnit) | ||
|
||
lExpected = [] | ||
utils.read_file(os.path.join(sTestDir, 'classification_results.txt'), lExpected, False) | ||
|
||
lActual = [] | ||
|
||
for oObject in utils.extract_objects(oFile, True): | ||
lActual.append(str(oObject)) | ||
|
||
self.assertEqual(lExpected, lActual) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters