In current implementation the user see something like the following when
ClassifyError is raised:
Error: Unexpected token detected while parsing procedure_call_statement @ Line 49, Column 22 in file None
Expecting : ;
Found : )
In a project that contains multiple files, the user is clueless as he does not
know which of the files caused the error.
This change adds the name of the file to the message.
Error while processing xxx:
Error: Unexpected token detected while parsing procedure_call_statement @ Line 49, Column 22 in file None
Expecting : ;
Found : )
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Issue#1054: Adding classification of pragmas.
* fix 'keyError: regexp' by dStyle having parse regexp and dConfig not (#1058)
* Adding pragma configuration tests.
* Stopping pragma search if a match is found.
* Refactoring classifications of pragmas to improve performance.
---------
Co-authored-by: Gerard Sharp <43923557+SittingDuc@users.noreply.github.com>
* 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>
* Support file configuration without scanning the file
Currently per file configuration is specified under `file_list`, the
`file_list` has side effect of scanning the file regardless of what files
provided in command-line.
Configuration should be able to specify per file configuration without adding
the file to the scan.
New implementation will look for the file under `file_rules` and merge it to
the existing `file_list` configuration to keep backward compatibility.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* Adding tests for the new file_rules configuration option.
* Updating documentation for file_rules
* Removing trailing lines.
* Refactored configure_rules to improve readability.
---------
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com>
Current implementation searches the file as provided by user or glob, this
name may be platform specific.
New implementation will always use '/' as separator, enabling the same
configuration to be used in any platform.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* adds basic functionality to send file to stdin
* updates usage docs to reflect stdin and adds new vim editor configs
* Adds better handling with stdin. Safer checks
* removes output over stdout for vhdl file since that's out of scope
* shortens cmd line args line to pass that check on codeclimate
* removes trailing white space
* changes is to == to prevent warning
* updates vim rst to have the null ls config ignore stderr
When editing a file sometimes things can cause VSG to fail and print to
stderr. If this happens, without ignoring stderr it will create an error
message in nvim, which was obnoxious
* Updates for issue #596
Adding feature to output quality report.
1) Added tests
2) Added quality_report command line argument
3) Output quality report
* Removing extra blank line.
* Removing unused import
* Adding documentation for integration with CI servers.
* Refocusing CI documentation to the output which is generated.
* Improving documentation:
1) Made JUnit example smaller
2) Minor grammar updates
* Adding link from table to heading.
* Adding link from table to content in page.
* Updates for issue #679
Fixing encoding issues when reading and writing files.
1) Added utf-8 encoding and decoding
2) Fixed issue with token map which was causing vsg to crash.
* Removing trailing whitespace.
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.
Adding validation for --backup command line argument.
1) Updated documentation to say --backup is only valid with --fix
2) Added tests
a) Testing --backup works with --fix
b) Testing --backup without --fix returns an error
3) Updated checking of --backup after parsing command line arguments
Fixing error where apply_rules was calling write_vhdl_file but it was not in the same file.
This was causing VSG to fail tests.
1) Moved function write_vhdl_file from __main__ to apply_rules