-
Notifications
You must be signed in to change notification settings - Fork 771
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
Format chosen files using Verible formatter #6027
Conversation
This looks like it might be a bit complicated to get merged, but most of the lint-fix changes look pretty uncontroversial to me. Maybe it would be worth splitting them into separate PRs? Then the "turn on the tool so I don't have to do things manually any more" PR ends up much smaller (and won't bit-rot quite as quickly). |
Thanks for this @rkapuscik Given the simplicity of the formatting changes I'd hope we could do this in one or two PRs (one for format changes the other for the scripting). I'd suggest squashing the commits down. Having all the formatting changes in a single commit is probably justifiable as they're all simple things and related in that they're all lint fixes to enable tooling. At least changes for related files should be squash together (no 'add changes', 'more changes' and 'final changes'). |
Thank you for your input, I moved the formatting changes to #6031 (to be updated after this PR is resolved) and kept here only files that were not affected by the Verible formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left some smallish comments, can you get those resolved and we can then merge it?
util/verible-format.sh
Outdated
|
||
case $MODE in | ||
allowlist) | ||
FILES_TO_FORMAT=`cat util/verible-format-allowlist.vbl | sed '/^#/d'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FILES_TO_FORMAT=`cat util/verible-format-allowlist.vbl | sed '/^#/d'` | |
FILES_TO_FORMAT=`grep -v '^#' util/verible-format-allowlist.vbl` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cleaner, thank you. Changed.
util/verible-format-allowlist.vbl
Outdated
@@ -0,0 +1,18 @@ | |||
# Copyright lowRISC contributors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a file with a .txt
suffix or so, .vbl
is for Verible waiver/config files which are consumed by Verible directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to .txt
.
util/verible-format-allowlist.vbl
Outdated
# This is a list of files to be passed to Verible formatter | ||
# by calling verible-format.sh | ||
|
||
./hw/ip/adc_ctrl/dv/tests/adc_ctrl_test_pkg.sv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need for the ./
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
util/verible-format.sh
Outdated
esac | ||
|
||
echo $FILES_TO_FORMAT | \ | ||
xargs -n 1 -P $NUM_PROCS verible-verilog-format \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xargs -n 1 -P $NUM_PROCS verible-verilog-format \ | |
xargs -n 1 -P $NUM_PROCS verible-verilog-format \ |
or align with the backslash above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Would you mind combining the two commits into one, and then I'll merge it?
For now it contains only files unchanged by the formatter. Signed-off-by: Rafal Kapuscik <[email protected]>
0380231
to
5473c34
Compare
No problem, I combined them. |
This PR introduces changes to Verible formatter script allowing it to format only a subset of OpenTitan files, along with a starting list of such files and relevant formatting fixes.
List of starting files was created by running Verible formatter on the project and adding ones that either needed no formatting or the changes were reviewed and found compliant to the lowRISC style guide. It is not complete in order to keep review manageable, but can be extended easily.
cc @GregAC, @imphil, @hzeller