Replies: 1 comment
-
Hey @imd1 , I would start with issue #578. You would just have to copy rules between function and procedure and modify the rule. For example, take I think we covered this before, but I wanted to walk through the process again.
Update DocumentationCopy the rule documentation from docs/procedure_rules.rst to docs/function_rules.rst. I started changing the way rules are numbered so they kind of match the phase the rule is ran in. Before all the rules were just numerically increased. I am not sure which way is better, but you will need to pick a number. You could just pick the next number, 018, or base it on the phase and start with 300. Why 300, well....I did not fully think this through and started with 000's for phase 1. So now everything is off. So rules in the 300's go with phase 4. Create TestSince functions and procedures are really close in syntax, you can copy the test files Modify the Run the test and it should fail. Add RuleIf we look at the rule located at vsg/rules/procedure/rule_006.py: 1
2 from vsg.rules import token_indent
3
4 from vsg import token
5
6 lTokens = []
7 lTokens.append(token.procedure_specification.close_parenthesis)
8
9
10 class rule_006(token_indent):
11 '''
12 Checks the indent of the closing parenthesis of the parameter list if it is on it's own line.
13 '''
14
15 def __init__(self):
16 token_indent.__init__(self, 'procedure', '006', lTokens) The rule extends the So to duplicate this rule for functions, you could copy vsg/rules/procedure/rule_006.py to vsg/rules/function/rule_018.py. Then modify lines 7, 10, and 16. 1
2 from vsg.rules import token_indent
3
4 from vsg import token
5
6 lTokens = []
7 lTokens.append(token.function_specification.close_parenthesis)
8
9
10 class rule_018(token_indent):
11 '''
12 Checks the indent of the closing parenthesis of the parameter list if it is on it's own line.
13 '''
14
15 def __init__(self):
16 token_indent.__init__(self, 'function', '018', lTokens) Then add the new rule to vsg/rules/function/init.py. 1
2 from .rule_001 import rule_001
3 from .rule_002 import rule_002
4 from .rule_003 import rule_003
5 from .rule_004 import rule_004
6 from .rule_005 import rule_005
7 from .rule_006 import rule_006
8 from .rule_007 import rule_007
9 from .rule_008 import rule_008
10 from .rule_009 import rule_009
11 from .rule_010 import rule_010
12
13 from .rule_012 import rule_012
14 from .rule_013 import rule_013
15 from .rule_014 import rule_014
16 from .rule_015 import rule_015
17 from .rule_016 import rule_016
18 from .rule_017 import rule_017
19 from .rule_018 import rule_018 Re-run TestRun the test again after the rule has been added and debug any failures. There is usually a base rule, located in I think once you get through aligning the procedure and function rules, and adding any new ones you would be read for the multiline alignment rules. Those rules are pretty tricky to implement if a base rule does not already exist. That would allow you to address issues #571, #566, #563, and #562. This would leave issues #593, #575, and #558. If you run into any issues, just ping me and I can help out. |
Beta Was this translation helpful? Give feedback.
-
I'm happy to help out and e.g. work on tickets I've raised :-). Which tickets do I have the best chance of completing?
Beta Was this translation helpful? Give feedback.
All reactions