How to run Gazelle on list of directories

552 views Asked by At

Context

I have a list of directories

- libs
  - lib1
  - lib2
  - lib3
  ...
- bin
- WORKSPACE
- BUILD.bazel
...

And I'd like to run gazelle on a subset of these directories that I've whitelisted.

I have hundreds of directories under libs/ and I want to incrementally rollout gazelle.

Question

Can I pass a filegroup to gazelle of the directories that it should check or is there some way to limit which directories gazelle goes over?

1

There are 1 answers

0
Noel Yap On

As some of the comments have indicated, gazelle accepts directory names on the command line, eg bazel run //:gazelle -- dir1 dir2.

If there are a lot of directories, try listing them out in a file then use a combination of cat and xargs. For example, cat dirs | xargs bazel run //:gazelle.