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

Options File #2362

Open
Remillard opened this issue Mar 7, 2025 · 1 comment
Open

Options File #2362

Remillard opened this issue Mar 7, 2025 · 1 comment
Labels
formatter Verilog code formatter issues

Comments

@Remillard
Copy link

Remillard commented Mar 7, 2025

The amount of options (and the length of the names) make the CLI somewhat tedious to work with. I've got a new file that will do indentation, however the inference is not working for alignment. Hence I'm looking at having to specify all the align parameters.

However, there is the --flagfile option but I've seen no documentation on how this file is to be formatted. Is it just one option per line, or a JSON or YAML format (similar to the Github action). An example somewhere in the documentation would be mighty useful.

Just as an example I tried putting the following in a txt file:

indentation_spaces=4
inplace=true

And I got the response:

ERROR: Unexpected line in the flagfile .\verible_fmt_flags.txt: indentation_spaces=4
ERROR: Unexpected line in the flagfile .\verible_fmt_flags.txt: inplace=true

So, clearly there's some expectation here that I'm not satisfying. Is there an example anywhere for this?

@Remillard Remillard added the formatter Verilog code formatter issues label Mar 7, 2025
@IEncinas10
Copy link
Collaborator

IEncinas10 commented Mar 9, 2025

verible-verilog-format --helpfull

shows

[...]

  Flags from external/com_google_absl/absl/flags/parse.cc:
    --flagfile (comma-separated list of files to load flags from); default: ;
    --fromenv (comma-separated list of flags to set from the environment [use
      'export FLAGS_flag1=value']); default: ;
    --tryfromenv (comma-separated list of flags to try to set from the
      environment if present); default: ;
    --undefok (comma-separated list of flag names that it is okay to specify on
      the command line even if the program does not define a flag with that
      name); default: ;

[...]

Note that the --flagfile option comes from the abseil flags library (I tried finding a better link but it the failed state where I live we block cloudflare IPs to "combat football piracy"), thats why it isn't really documented here.

You just need to write the flags in verible_fmt_flags.txt like you would in the command line

-indentation_spaces=4
-inplace=true
+--indentation_spaces=4
+--inplace=true

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

2 participants