Added missing dependencies and added example with integration test. (#6)
This repo contains bazel rules for buildifier and buildozer using prebuilt binaries with bazel toolchains instead of requiring you depend on rules_go. This also means you won‘t download every possible version of these binaries, you’ll only download the ones for the platform you're running on.
You can create a rule for running buildifier:
load("@buildifier_prebuilt//:rules.bzl", "buildifier") buildifier( name = "buildifier.check", exclude_patterns = [ "./.git/*", ], lint_mode = "warn", mode = "diff", )
That can be run with:
bazel run //:buildifier.check
Or you can run buildifier or buildozer directly:
bazel run -- @buildifier_prebuilt//:buildozer ARGS bazel run -- @buildifier_prebuilt//:buildifier ARGS
Checkout the releases page for snippets for your WORKSPACE