Skip to content
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

Vendor buildifier #3

Open
TheButlah opened this issue Apr 14, 2020 · 2 comments
Open

Vendor buildifier #3

TheButlah opened this issue Apr 14, 2020 · 2 comments

Comments

@TheButlah
Copy link
Contributor

It would be awesome if the buildifier hook could download buildifier instead of assuming that it is system installed. Buildifier is a go program, so it can simply be wgetted from the github repository with a simple check to determine whether the os is windows, mac, or linux.

@jlebar
Copy link
Owner

jlebar commented May 29, 2020

Agree that would be way better.

I'd be happy to take a patch, now that I'm subscribed to updates to this repo. :)

@ScottTodd
Copy link

This worked for me, downloading buildifier from the source repo on Windows and Linux using golang bootstrapping from pre-commit 3.0.0+ (https://pre-commit.com/#golang):

-   repo: local
    hooks:
    -   id: buildifier
        name: Run buildifier
        entry: buildifier
        language: golang
        additional_dependencies: ["github.com/bazelbuild/buildtools/buildifier@1429e15ae755a6762d0edf9198062dc6ed04408d"]
        files: '^(.*/)?(BUILD\.bazel|BUILD|WORKSPACE|WORKSPACE\.bazel|WORKSPACE\.bzlmod|MODULE\.bazel)$|\.BUILD$|\.bzl$'
        language_version: "1.16"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants