Issue#961: Fixing indenting of comments in return statements. (#963)

This commit is contained in:
Jeremiah Leary 2023-11-06 16:10:31 -06:00 committed by GitHub
parent 3931a87a59
commit 0576f7d15e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 2 deletions

View File

@ -86,3 +86,20 @@ package fifo_pkg is
-- Comment 2c
end package;
package body function_pkg is
function init_axi4_aw (
aw : in axi4_aw_t;
ival : std_logic := 'Z'
) return axi4_aw_t is
begin
return (
-- AXI4 Lite <<< HERE
addr => (aw.addr'range => ival),
-- AXI 4 Full <<< AND HERE
id => (aw.id'range => ival),
len => (aw.len'range => ival)
);
end function init_axi4_aw;
end package body function_pkg;

View File

@ -86,3 +86,20 @@ package fifo_pkg is
-- Comment 2c
end package;
package body function_pkg is
function init_axi4_aw (
aw : in axi4_aw_t;
ival : std_logic := 'Z'
) return axi4_aw_t is
begin
return (
-- AXI4 Lite <<< HERE
addr => (aw.addr'range => ival),
-- AXI 4 Full <<< AND HERE
id => (aw.id'range => ival),
len => (aw.len'range => ival)
);
end function init_axi4_aw;
end package body function_pkg;

View File

@ -30,7 +30,7 @@ class test_comment_rule(unittest.TestCase):
self.assertEqual(oRule.name, 'comment')
self.assertEqual(oRule.identifier, '010')
lExpected = [3, 8, 10, 11, 14, 15, 16, 19, 27, 28, 33, 34, 66, 68, 74, 80, 86]
lExpected = [3, 8, 10, 11, 14, 15, 16, 19, 27, 28, 33, 34, 66, 68, 74, 80, 86, 99]
oRule.analyze(self.oFile)
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))

View File

@ -428,7 +428,10 @@ indent:
return_statement:
return_keyword:
token : current
after : current
after : '+1'
semicolon:
token : current
after : '-1'
selected_force_assignment:
with_keyword:
token : current