Skip to content

Commit

Permalink
Disable label rewrite if shortenLabelsFlag is false (#359)
Browse files Browse the repository at this point in the history
shortenLabelsFlas is being used in edit ShortenLabels function
but not used in rewrite ShortenLabels, which causes all the labels to be
shorten though this flag it is set to false.
  • Loading branch information
burakcoskun authored and pmbethe09 committed Aug 27, 2018
1 parent 17bb65e commit 3255d39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions buildozer/BUILD.bazel
Expand Up @@ -6,6 +6,7 @@ go_library(
importpath = "github.com/bazelbuild/buildtools/buildozer",
visibility = ["//visibility:private"],
deps = [
"//build:go_default_library",
"//edit:go_default_library",
"//tables:go_default_library",
],
Expand Down
4 changes: 4 additions & 0 deletions buildozer/main.go
Expand Up @@ -20,6 +20,7 @@ import (
"os"
"strings"

"github.com/bazelbuild/buildtools/build"
"github.com/bazelbuild/buildtools/edit"
"github.com/bazelbuild/buildtools/tables"
)
Expand Down Expand Up @@ -75,6 +76,9 @@ func main() {
}
}

if !(*shortenLabelsFlag) {
build.DisableRewrites = []string{"label"}
}
edit.ShortenLabelsFlag = *shortenLabelsFlag
edit.DeleteWithComments = *deleteWithComments
opts := &edit.Options{
Expand Down

0 comments on commit 3255d39

Please sign in to comment.