WIP: Gazelle filegroup generation and buildifier_test #1589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
gazelle
rules to use the extensionbuildifier_test
rule to replacebuildifier
withcheck
.There are two type of filegroups. The
all_files
groups make all files in a directory available for the futurehaskell_bazel_test
. These groups are not included in this PR. Thestarlark_files
groups makeBUILD
,WORKSPACE
and other Starlark files available forbuildifier_test
.TODO: Gazelle doesn't work properly in nested workspaces.
For example, in
examples/BUILD.bazel
:Two problems here:
srcs
paths are relative to the top-level workspace, and not the nested onebazel-*
directories, which it doesn't do at the top levelThings to try:
rules_haskell/examples$ bazel run //:gazelle_starlark_files
), and don't let the top level run (rules_haskell$ bazel run //:gazelle_starlark_files
) go into the nested workspace at allTODO: Check that Gazelle is including the correct files and directories.
Some of these might need to be specified manually. For example,
*.md
should probably be excluded, even fromall_files
, and that doesn't appear to be happening yet.TODO: something in the CI to run Gazelle to make sure that the filegroups are generated
TODO: try buildifer_test in the nested workspaces: examples, examples/arm, tutorial, tests/c2hs/repo