Added missing dependencies and added example with integration test. (#6)

13 files changed
tree: 95407c30051d566e4790b1eaaeee9ab755a30e93
  1. .github/
  2. examples/
  3. tests/
  4. .bazelrc
  5. .gitignore
  6. bazel_versions.bzl
  7. BUILD
  8. defs.bzl
  9. LICENSE
  10. README.md
  11. rules.bzl
  12. runner.bash.template
  13. toolchain.bzl
  14. WORKSPACE
README.md

buildifier-prebuilt

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.

Usage

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

Installation

Checkout the releases page for snippets for your WORKSPACE