bazel-contrib / bazel-contrib/buildtools

buildifier examines .git

Open
#1,298 4 comments 4 reactions 0 assignees View on GitHub
P3
Dominant language
Go
Stars
1.2k
Forks
471
Avg merge
2d 22h
Merged PRs (30d)
13

Description

Buildifier attempts to scan the entire working directory. If you have a git repo, it looks in `.git` as well. That means that if your remote has a branch called `foobar.bzl`, buildifier fix will see that it is an invalid value.

Note that you can use `exclude_patterns` BUT then:
```
Error in fail: Cannot use 'exclude_patterns' in a test rule without 'no_sandbox'
```

And then if you set `no_sandbox`:
```
Error in fail: Cannot use 'no_sandbox' without a 'workspace'
```

And this is where we are stuck. We have tried multiple formats for this parameter:
`workspace = "WORKSPACE"`, `workspace = "/home/jeff/mycheckout/WORKSPACE"`, `workspace = "//WORKSPACE"` and more. There is no clear documentation for this and we have been unable to move beyond this. If someone can clue me into the correct syntax I'll happily update and PR the docs. (Of course, I don't quite understand why `exclude_patterns` requires `no_sandbox`, or why the workspace can't default to the current workspace.)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Buildifier's scan of a Git working directory containing a remote branch named foobar.bzl. Then investigate the exclude_patterns, no_sandbox, and workspace configuration described in the report. Done means .git is not treated as input and the valid workspace syntax or required documentation is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.