xlsynth / bedrock-rtl

High quality and composable base RTL libraries in Verilog
Apache License 2.0
7 stars 1 forks source link

Set up Verible lint and format tests with Bazel; bring up `@rules_hdl` #15

Closed mgottscho closed 4 weeks ago

mgottscho commented 4 weeks ago

Future work outlined in //bazel:verible.bzl:

# TODO(mgottscho): The lint and format rules here are not the ideal solution.
# We'd prefer to only run the linter and formatter on the changed lines in a
# git diff so that we can change the lint/format rules over time (if needed)
# and have the tests gradually ratchet over the codebase. I'm fine with this
# non-ideal solution for now, though, since we're setting this up on a fresh
# codebase and moving fast.
#
# The ideal solution would probably look like this:
#
# bazel run //:verible-format      # Test only changed lines
# bazel run //:verible-format-fix  # Test and fix changed lines in-place
#
# bazel run //:verible-format -- <file1.sv> <file2.sv>  # Run on specific files
# bazel run //:verible-format-fix -- <file1.sv> <file2.sv>  # Fix specific files
#
# bazel run //:verible-format -- --all      # Test all lines
# bazel run //:verible-format-fix -- --all  # Fix all lines