-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBUILD
92 lines (84 loc) · 1.57 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
subinclude("//build_defs/npm")
subinclude("//build_defs/npm:vitest")
subinclude("//build_defs/sh")
filegroup(
name = "pnpm_config",
srcs = [
"package.json",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
],
visibility = [
"//src/..."
],
)
filegroup(
name = "prettier",
srcs = [".prettierrc"],
visibility = ["//src/..."],
)
# pnpm(
# name= "pnpm",
# version = "v16.7.0",
# )
npm_install(
name = "pnpm_install",
srcs = [
":pnpm_config",
"//src/cockpit:package_json"
],
)
sh_tools_cmd(
name = "lint_all",
# TODO: Turn this into rules to run in parallel instead of sequential.
cmd = " && ".join([
"./pleasew run //:eslint",
"./pleasew run //:gofmt",
"./pleasew run //:staticcheck",
"echo 'All lints completed!'",
]),
deps = [
":eslint",
":gofmt",
],
)
npm_lint(
name = "eslint",
cmd = "format",
visibility = [
"//src/cockpit/..."
],
srcs = [
":pnpm_install",
":pnpm_config",
":prettier",
"//src/assets:assets",
"//src/cockpit:core_files",
],
deps = [
"//src/wings/enum",
"//src/wings/struct",
],
)
sh_tools_cmd(
name = "staticcheck",
cmd = " && ".join([
"cd $(pwd | awk -F'plz-out' '{print $1}')",
"for DIR in \\\\$(ls -d src/turbine/*/); do staticcheck \\\\$DIR*.go; done",
]),
deps = [
"//src/turbine:main",
],
)
sh_tools_cmd(
name = "gofmt",
cmd = " && ".join([
"cd $(pwd | awk -F'plz-out' '{print $1}')",
"gofmt -s -w src/turbine/**/*.go",
]),
deps = [
"//src/turbine:main",
"//src/wings/enum",
"//src/wings/struct",
],
)