Skip to content

[buildifier] Add ability to ignore paths when searching recursively for files #801

@joeljeske

Description

@joeljeske

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:

  1. Add an -exclude flag that can be passed for each path to ignore
  2. Add a .buildifierignore file that can be checked in to the repo to ignore paths when finding files

Workarounds:

  1. Manually specify all paths and directories to search through except my managed directory
  2. Go back to using find, which negates the value of -r and makes it not portable again.

cc @alexeagle

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions