rules_vsg 0.1.0Latest published 6h ago
MODULE.bazel
bazel_dep(name = "rules_vsg", version = "0.1.0")
README

rules_vsg

Bazel rules that run VSG (VHDL Style Guide) against vhdl_library targets.

  • vsg_test — Bazel test rule that lints a vhdl_library and fails on violations.
  • vsg_fixerbazel run-able target that applies vsg --fix in place to the workspace sources.
  • vsg_aspect — aspect that runs VSG as a side effect of bazel build, opt-in via .bazelrc.

Full documentation, setup instructions, and rule reference: https://hw-bzl.github.io/rules_vsg/.

Quick start

load("@rules_vhdl//vhdl:defs.bzl", "vhdl_library")
load("@rules_vsg//vsg:defs.bzl", "vsg_fixer", "vsg_test")

vhdl_library(
    name = "math_pkg",
    srcs = ["math_pkg.vhd", "adder.vhd"],
)

vsg_test(
    name = "math_pkg_vsg_test",
    target = ":math_pkg",
    config = ":vsg_config.yaml",
)

vsg_fixer(
    name = "math_pkg_vsg_fix",
    target = ":math_pkg",
    config = ":vsg_config.yaml",
)

Then:

  • bazel test //:math_pkg_vsg_test — fails on violations
  • bazel run //:math_pkg_vsg_fix — applies vsg --fix to the workspace files

rules_vsg ships with no registered toolchain — you supply vsg as a Python library and register a vsg_toolchain. See the documentation for the full wiring.

About

Bazel rules for VSG (VHDL Style Guide)

@hw-bzl/rules_vsg@hw-bzl

Languages

Python28.7%
VHDL3.1%

Maintainers

@UebelAndre

Compatibility

Versions

0.1.02026-06-12