Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter fails to converge due to attribute for port and comment (with a few spaces) after second port definition #2349

Open
david-sawatzke opened this issue Feb 6, 2025 · 0 comments
Labels
formatter Verilog code formatter issues

Comments

@david-sawatzke
Copy link

Test case

module foo (
    (* something *) input  logic bar,
                    input  logic barfoo            // comment

);
endmodule

with verible-verilog-format foo.sv

Actual output

foo.sv: Re-formatted text does not match formatted text; formatting failed to converge!  Please file a bug.
========== Original: --lines: ==========
module foo (
    (* something *) input  logic bar,
                    input  logic barfoo            // comment

);
endmodule
============== Formatted: ==============
module foo (
    (* something *) input logic bar,
                    input logic barfoo  // comment

);
endmodule
============= Re-formatted: ============
module foo (
    (* something *) input logic bar,
    input logic barfoo  // comment

);
endmodule
============== Diffs are: ==============
 module foo (
     (* something *) input logic bar,
-                    input logic barfoo  // comment
+    input logic barfoo  // comment
 
 );
 endmodule
; problematic formatter output is
module foo (
    (* something *) input logic bar,
                    input logic barfoo  // comment

);
endmodule
<<EOF>>

Expected or suggested output
When manually removing the spaces before the comment, the formatter does work as the first formatting step is skipped:

module foo (
    (* something *) input  logic bar,
                    input  logic barfoo // comment

);
endmodule

Result:

module foo (
    (* something *) input logic bar,
    input logic barfoo  // comment

);
endmodule
@david-sawatzke david-sawatzke added the formatter Verilog code formatter issues label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Verilog code formatter issues
Projects
None yet
Development

No branches or pull requests

1 participant