The -r option is very nice and helpful. Thanks!
In my workspace, I have a bazel managed directory node_modules that contains some .bzl files. (This directory contains 3rd party artifacts from the npm registry managed by rules_nodejs.) The issue is that when buildifier is run recursively from the root, it finds files in this directory and changes them. This results in cache misses due to the files being changed.
Possible Solutions:
- Add an
-exclude flag that can be passed for each path to ignore
- Add a
.buildifierignore file that can be checked in to the repo to ignore paths when finding files
Workarounds:
- Manually specify all paths and directories to search through except my managed directory
- Go back to using
find, which negates the value of -r and makes it not portable again.
cc @alexeagle