Closed gmlarumbe closed 2 years ago
I'm wondering if this one is a personal preference? My concern is package is similar to "namespace" in C++ where there's two opinions on indenting the contents. Also if someone has code in the old style this seems like a big change they might not want and so would need to disable.
Thoughts?
I agree that it could be a personal preference. However, it seems to me more consistent indenting classes inside packages since the rest of constructs also get indented (typedefs, localparams, functions, tasks...). For example:
package foo;
typedef logic [7:0] byte_t;
localparam byte_t ALL_ONES = 8'hFF;
function foo3 (input int a);
$display(a);
endfunction
class A;
byte_t foo2 = ALL_ONES;
endclass
endpackage
In my opinion, either everything should be indented or not, but only classes get zero indentation.
To maintain backwards compatibility maybe this could be configured by using a variable (verilog-indent-class-inside-pkg
).
Yes, I think adding a variable would be perfect, I think it's ok to default to indenting (new style).
Done!
Can you please fill out https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future if you have not already as your much appreciated changes may soon be flagged for assignment.
This PR fixes indentation of classes inside packages.
Related issue: #286