Replies: 4 comments 7 replies
-
Modified the json file and also tried a yaml file (as the rule group example is in yaml). Neither configuration reported and violations, so subsequently no changes to the vhdl file. modified json rule file
yaml rule file
|
Beta Was this translation helpful? Give feedback.
-
I wondered if after globally disabling everything, the keyword group needed to be enabled.
After setting 'disable' false, most of the keywords were capitalized. Some of the keywords that weren't capitalized (but were expected to be) included:
The vhdl code that was used had an empty entity (no port list) and no component prototypes. So it's not certain if the direction parameters in port lists are capitalized with the group setting. |
Beta Was this translation helpful? Give feedback.
-
Hi @urbite.
As you've discovered, after disabling all rules, you need to enable the rules that you want to check; otherwise, no rules will be checked. To answer your original question, you need to use {
"rule":{
"group":{
"case::keyword" : {
"case": "upper"
}
}
}
}
Thanks for doing this check and putting this list together. I've raised an issue already and am working on a PR to get case rules in place for parameter directions in procedures and functions. For the others, feel free to raise issues. I recommend raising separate issues for different keywords to make the work easier to manage. If you don't raise the issues, I'll work through your list and raise issues as I go.
I can confirm that port directions have a case rule: ENTITY FIFO IS
PORT (
clk : in STD_LOGIC;
sig : out STD_LOGIC;
dat : inout STD_LOGIC
);
END ENTITY FIFO; Config: {
"rule":{
"group":{
"case::keyword" : {
"case": "upper"
}
}
}
} Output
|
Beta Was this translation helpful? Give feedback.
-
I just saw this discussion and thought I should jump in. @urbite there is a page of documentation which lists all the keyword case rules. As you have realized there is a rule for each keyword and not all of them have been implemented. I really appreciate @JHertz5 , creating the rules for to catch the ones you have identified. I'm wondering if we could maybe grep for all the keywords in I will prioritize checking the PRs @JHertz5 has implemented. Thanks again. --Jeremy |
Beta Was this translation helpful? Give feedback.
-
A customer's project requires all VHDL keywords to be capitalized. I've had to replace my SHFT keyswitch 3 times 😁
The following in the docs regarding setting case for all keywords seems to point to the solution.
https://vhdl-style-guide.readthedocs.io/en/latest/configuring_rule_groups.html
As a json neophyte, I didn't see how to handle the rule group :: syntax in the json file.
Initially I'd like to use vsg to just uppercase all the keywords. I found an example on how to disable all rules, then attempted to add the rule group to just uppercase the keywords. Here's the resulting json file, vsg_keyworks_us.json that was created.
Here's the command used to apply the rules to the target vhdl file, along with the results. Examining the file shows that no keywords were changed to uppercase.
Any suggestions or help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions