Comments (5)
Afternoon @JHertz5 ,
I had to change the match
to an if
statement in the get_rule_name
function to support pre 3.10 python. Otherwise it looks really good.
It sure cleans up with the code by reducing the number of arguments passed to the base rule class.
There were almost a 1000 files changed, so I appreciate the effort you put in to make development easier. I will have to keep my eye open for any other similar improvements that can be made.
I will push this to master.
Thanks again,
--Jeremy
from vhdl-style-guide.
I have created a draft PR, #1118 to demonstrate the change. I will update the PR when I have time, likely this weekend, to remove the now-redundant identifier
input to the Rule.__init__()
method.
from vhdl-style-guide.
Morning @JHertz5 ,
I really like this idea. I can't count the number of times I have not updated either name
or identifier
, which is why there is always a test to check them. However, ensuring they are correct by using code is a much better solution.
For the name
attribute, we could check for exceptions and replace. For example, the if
rules are in the if_statement
directory.
dir_name = get_current_directory_name()
if dir_name == 'if_statement':
rule_name = 'if'
else:
rule_name = dirname
That could be a stop gap until a real refactoring of rule names could take place.
Or maybe the directory names can change to match the rule name? For some reason I named the rule directory if_statement
instead of if
. I would like to think there was some conflict with python since if
is a python keyword. but then again maybe not.
--Jeremy
from vhdl-style-guide.
Amazing, I'm glad that you like the suggestion! I'll be glad if I can make your life a tiny bit easier.
For the name attribute, we could check for exceptions and replace. For example, the if rules are in the if_statement directory.
That is a great idea. I'll include this in the PR, and renaming of rules or directories can come later. You might find it preferable to have infrastructure for exceptions; maybe there are cases where you'd like to have a more detailed directory name while keeping the rule name short, or as you say, there might be some conflict/confusion with Python keywords.
from vhdl-style-guide.
Hi @jeremiah-c-leary, thanks again for your advice. I have marked PR #1118 as "ready for review". There are a lot of files touched, which means that there is a high likelihood of causing conflicts on other branches, but they should be easy to resolve. Apart from the changes in vsg/rule.py and in the tests directory, the changes are just removing the name
and identifier
arguments from init functions everywhere.
from vhdl-style-guide.
Related Issues (20)
- Running the unit tests leaves behind a file in the root of the repository HOT 2
- Exception on valid VHDL " 'close_parenthesis' object has no attribute 'iId' " when using --all_phases HOT 2
- Hang on malformed array range followed by unclosed port HOT 5
- port_026 missing closing parenthesis in split ports HOT 3
- Code block is not showing on Configuring Multiline Indent Rules page HOT 2
- procedure_call_003 alignment glitch with positional parameters HOT 3
- interface_list reprocesses the same interface_element multiple times HOT 2
- Add documentation: Rule is (auto)fixable HOT 7
- Rules variable_011 and variable_assignment_008 are failing after late merge.
- The flag '--fix' in default pre-commit-hook entry HOT 7
- Support parallel tests HOT 2
- docs: Typos HOT 3
- Configuration JSON format is not JSON compliant HOT 5
- Remove invalid escape sequences from docstring HOT 6
- Consider removing vsg/rules/__init__.py and vsg/vhdlFile/extract/__init__.py import index files
- Enable pylint in project
- Documentation issues
- Subtype exceptions HOT 6
- pytest occasionally reports an issue but does not fail
- Manifest.in is out of date.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vhdl-style-guide.