Remove unnecessary snake case variables.
Test: m nothing + TreeHugger
Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
diff --git a/android/androidmk.go b/android/androidmk.go
index 062dcb3..73f60d0 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -627,7 +627,7 @@
fmt.Fprintln(buf, "LOCAL_MODULE_MAKEFILE := $(lastword $(MAKEFILE_LIST))")
- type_stats := make(map[string]int)
+ typeStats := make(map[string]int)
for _, mod := range mods {
err := translateAndroidMkModule(ctx, buf, mod)
if err != nil {
@@ -636,19 +636,19 @@
}
if amod, ok := mod.(Module); ok && ctx.PrimaryModule(amod) == amod {
- type_stats[ctx.ModuleType(amod)] += 1
+ typeStats[ctx.ModuleType(amod)] += 1
}
}
keys := []string{}
fmt.Fprintln(buf, "\nSTATS.SOONG_MODULE_TYPE :=")
- for k := range type_stats {
+ for k := range typeStats {
keys = append(keys, k)
}
sort.Strings(keys)
for _, mod_type := range keys {
fmt.Fprintln(buf, "STATS.SOONG_MODULE_TYPE +=", mod_type)
- fmt.Fprintf(buf, "STATS.SOONG_MODULE_TYPE.%s := %d\n", mod_type, type_stats[mod_type])
+ fmt.Fprintf(buf, "STATS.SOONG_MODULE_TYPE.%s := %d\n", mod_type, typeStats[mod_type])
}
// Don't write to the file if it hasn't changed
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index 81ca475..357b99f 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -387,25 +387,25 @@
if err != nil {
return err
}
- cquery_file_relpath := filepath.Join(context.intermediatesDir(), "buildroot.cquery")
+ cqueryFileRelpath := filepath.Join(context.intermediatesDir(), "buildroot.cquery")
err = ioutil.WriteFile(
- absolutePath(cquery_file_relpath),
+ absolutePath(cqueryFileRelpath),
context.cqueryStarlarkFileContents(), 0666)
if err != nil {
return err
}
- workspace_file_relpath := filepath.Join(context.intermediatesDir(), "WORKSPACE.bazel")
+ workspaceFileRelpath := filepath.Join(context.intermediatesDir(), "WORKSPACE.bazel")
err = ioutil.WriteFile(
- absolutePath(workspace_file_relpath),
+ absolutePath(workspaceFileRelpath),
context.workspaceFileContents(), 0666)
if err != nil {
return err
}
- buildroot_label := "//:buildroot"
+ buildrootLabel := "//:buildroot"
cqueryOutput, err = context.issueBazelCommand(bazel.CqueryBuildRootRunName, "cquery",
- []string{fmt.Sprintf("deps(%s)", buildroot_label)},
+ []string{fmt.Sprintf("deps(%s)", buildrootLabel)},
"--output=starlark",
- "--starlark:file="+cquery_file_relpath)
+ "--starlark:file="+cqueryFileRelpath)
if err != nil {
return err
@@ -432,7 +432,7 @@
// TODO(cparsons): Use --target_pattern_file to avoid command line limits.
var aqueryOutput string
aqueryOutput, err = context.issueBazelCommand(bazel.AqueryBuildRootRunName, "aquery",
- []string{fmt.Sprintf("deps(%s)", buildroot_label),
+ []string{fmt.Sprintf("deps(%s)", buildrootLabel),
// Use jsonproto instead of proto; actual proto parsing would require a dependency on Bazel's
// proto sources, which would add a number of unnecessary dependencies.
"--output=jsonproto"})