-
Notifications
You must be signed in to change notification settings - Fork 107
New buildifier versions need to be told what type of file they're formatting #128
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
Comments
In the past we have done this by having a small invoke to test the version |
Note that #100 previously fixed this because |
Seems like it is using the path even if that's not what's documented? |
Sorry, I should have mentioned the version I'm on.
Here are my results:
Here's what I get when I modify that to specify the
|
Interesting. What does I get:
|
What version are you on? Also, here's where the |
I was just trying to figure out the version. We seem to be using some internally-built shim, but I think the core code corresponds to https://github.com/bazelbuild/buildtools/commits/89ce10de6b39666331d0d91c0d7e5a146a920cef. |
`--path` is not working on buildifier 0.25.1. Fixes google#128, but only for users whose buildifier is newer than bazelbuild/buildtools#232. For other users, this will likely crash.
OK. Well, I switched to my fork as a temporary workaround. Not ready to make a PR yet, since I think it would break old users! It looks like your version is much newer than mine, as it's from earlier this month. So maybe this was a bug that got fixed? |
Ah. Yes, it was fixed recently: bazelbuild/buildtools#681, which looks like it made it into 0.28.0. (I assume it was broken at some point prior to that, since we know it worked last year.) |
Okay, I'll call this resolved, but let's reopen if more people run into this and we need some kind of version guard. |
Apparently,
buildifier
is for more than justBUILD
files these days. See here: https://github.com/bazelbuild/buildtools/pull/431/filesThe upshot is that, in order to format
BUILD
files,buildifier
needs to know what type of file it's formatting. This is done with the-type
flag, as in:There are probably several different ways we could go here. We could introduce
buildifier_options
, but that conflicts with some of the desires expressed in #66. Probably the best way would be forcodefmt
to decide what flags to pass based on the filename, so we would automatically do the right thing for both.bzl
andBUILD
files... although, this might not work well for older versions ofbuildifier
!The text was updated successfully, but these errors were encountered: