From 691d7e55e0bf045f7ce112b3ebe10753f194b477 Mon Sep 17 00:00:00 2001 From: Raphael Vigee Date: Mon, 20 Nov 2023 12:49:27 +0000 Subject: [PATCH] heph fmt --- backend/go/BUILD | 45 ++++++++++++++++----------------- test/features/deep-gen.BUILD | 6 ++--- test/go/mod-custom-labels/BUILD | 10 +------- test/go/work/mod-a/BUILD | 6 ++--- 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/backend/go/BUILD b/backend/go/BUILD index 9aa58431..50625f6c 100644 --- a/backend/go/BUILD +++ b/backend/go/BUILD @@ -108,15 +108,15 @@ def _find_go_work(): parts = heph.path.split(heph.pkg.dir()) prefix = "." - for i in range(0, len(parts)+1): - p = prefix+"/go.work" + for i in range(0, len(parts) + 1): + p = prefix + "/go.work" if len(glob(p)) > 0: return p prefix += "/.." - fail("unable to locate work file from "+heph.pkg.dir()) + fail("unable to locate work file from " + heph.pkg.dir()) def go_mod( mod_pkgs = [], @@ -166,7 +166,7 @@ def go_mod( if work: p = _find_go_work() godeps_deps += [p] - godeps_deps += glob(p+".sum") + godeps_deps += glob(p + ".sum") imports = target( name = "_go_mod_gen_imports", @@ -181,19 +181,17 @@ def go_mod( (pkg, _, _) = heph.split(go) mod_pkgs_gen = [ - "//"+pkg+":_std_pkgs_*", + "//" + pkg + ":_std_pkgs_*", "go_lib", "go_build_bin", "test", "thirdparty", "go-test", - "//thirdparty/go/**:_go_mod_download*" + "//thirdparty/go/**:_go_mod_download*", ] - for pkg in mod_pkgs+['//thirdparty/go']: - mod_pkgs_gen += [ - pkg+"/**:_go_lib*", - ] + for pkg in mod_pkgs + ["//thirdparty/go"]: + mod_pkgs_gen += [pkg + "/**:_go_lib*"] # Add labels defined in cfg for pkg in cfg.values(): @@ -203,21 +201,22 @@ def go_mod( labels = pkg["test"]["run"]["labels"] if type(labels) != "list": labels = [labels] + mod_pkgs_gen += labels mod_pkgs_gen += [ - heph.pkg.addr()+"/**:_go_lib*", - heph.pkg.addr()+"/**:go_bin#build*", - heph.pkg.addr()+"/**:_go_test_lib*", - heph.pkg.addr()+"/**:_go_xtest_lib*", - heph.pkg.addr()+"/**:_go_testmain_lib*", - heph.pkg.addr()+"/**:_go_xtestmain_lib*", - heph.pkg.addr()+"/**:_go_gen_testmain*", - heph.pkg.addr()+"/**:_go_gen_xtestmain*", - heph.pkg.addr()+"/**:_go_test#build*", - heph.pkg.addr()+"/**:_go_xtest#build*", - heph.pkg.addr()+"/**:go_test*", - heph.pkg.addr()+"/**:go_xtest*", + heph.pkg.addr() + "/**:_go_lib*", + heph.pkg.addr() + "/**:go_bin#build*", + heph.pkg.addr() + "/**:_go_test_lib*", + heph.pkg.addr() + "/**:_go_xtest_lib*", + heph.pkg.addr() + "/**:_go_testmain_lib*", + heph.pkg.addr() + "/**:_go_xtestmain_lib*", + heph.pkg.addr() + "/**:_go_gen_testmain*", + heph.pkg.addr() + "/**:_go_gen_xtestmain*", + heph.pkg.addr() + "/**:_go_test#build*", + heph.pkg.addr() + "/**:_go_xtest#build*", + heph.pkg.addr() + "/**:go_test*", + heph.pkg.addr() + "/**:go_xtest*", ] target( @@ -330,7 +329,7 @@ def go_library( src_dep = None, gen_embed = False, ): - pvt_name = name if name[0] == "_" else "_"+name + pvt_name = name if name[0] == "_" else "_" + name p = dir + "/" if dir else "" diff --git a/test/features/deep-gen.BUILD b/test/features/deep-gen.BUILD index 1d0491a6..8301900d 100644 --- a/test/features/deep-gen.BUILD +++ b/test/features/deep-gen.BUILD @@ -31,10 +31,10 @@ target( deps = deep_gen_1, out = "deep-gen-0.BUILD", gen = [ - ':deep_gen_1', - ':hello_build', + ":deep_gen_1", + ":hello_build", # deep: - ':hello-deep-gen', + ":hello-deep-gen", ], ) diff --git a/test/go/mod-custom-labels/BUILD b/test/go/mod-custom-labels/BUILD index b2cdec41..26afa0ab 100644 --- a/test/go/mod-custom-labels/BUILD +++ b/test/go/mod-custom-labels/BUILD @@ -2,13 +2,5 @@ load("//backend/go", "go_mod") load("//backend/go", "go_bin") go_mod( - cfg={ - "...": { - "test": { - "run": { - "labels": "mytest" - } - } - } - } + cfg = {"...": {"test": {"run": {"labels": "mytest"}}}}, ) diff --git a/test/go/work/mod-a/BUILD b/test/go/work/mod-a/BUILD index 2d75c357..677f269f 100644 --- a/test/go/work/mod-a/BUILD +++ b/test/go/work/mod-a/BUILD @@ -1,8 +1,6 @@ load("//backend/go", "go_mod") go_mod( - mod_pkgs = [ - '//test/go/work/mod-b' - ], - work = True + mod_pkgs = ["//test/go/work/mod-b"], + work = True, )