-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
122 lines (104 loc) · 3.05 KB
/
BUILD.bazel
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("//bazel/rules_clang_format:def.bzl", "clang_formatter")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@nl_tulipsolutions_bazel_tools//rules_ktlint:def.bzl", "ktlint")
load("@nl_tulipsolutions_bazel_tools//rules_intellij_formatter:def.bzl", "intellij_formatter")
load("@nl_tulipsolutions_bazel_tools//rules_addlicense:def.bzl", "addlicense")
load("//bazel/rules_gofmt:def.bzl", "gofmt")
load("//bazel/rules_flake8:def.bzl", "flake8")
load("@flake8_deps//:requirements.bzl", "requirement")
define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.3",
jvm_target = "11",
language_version = "1.3",
)
exclude_patterns = [
"./third_party/protoc-gen-validate/*",
"*node_modules*",
# Below are the defaults for most formatting rules (please keep in sync).
".*.git/*",
".*.project/*",
".*idea/*",
"./.ijwb/*",
]
# Formatting for BUILD, BUILD.bazel and WORKSPACE files
buildifier(
name = "buildifier_check",
diff_command = "diff -u",
exclude_patterns = exclude_patterns,
mode = "diff",
verbose = True,
)
buildifier(
name = "buildifier_format",
exclude_patterns = exclude_patterns,
mode = "fix",
)
clang_formatter(
name = "clang_format",
exclude_patterns = exclude_patterns,
)
clang_formatter(
name = "clang_format_check",
exclude_patterns = exclude_patterns,
mode = "check",
)
# Force Gazelle to create one rule per proto package using go_package option
# Until https://github.com/bazelbuild/bazel-gazelle/issues/138 is resolved
# gazelle:proto package
# gazelle:proto_group go_package
# gazelle:prefix github.com/tulipsolutions/tecl
# gazelle:resolve proto proto validate/validate.proto @com_envoyproxy_protoc_gen_validate//validate:validate_proto
# gazelle:resolve proto go validate/validate.proto @com_envoyproxy_protoc_gen_validate//validate:go_default_library
# gazelle:exclude docs
# gazelle:exclude third_party/protoc-gen-validate
# gazelle:exclude node_modules
# gazelle:exclude examples/node/node_modules
# gazelle:ignore
gazelle(
name = "gazelle",
gazelle = "//bazel/gazelle",
)
addlicense(
name = "addlicense_format",
copyright_holder = "Tulip Solutions B.V.",
exclude_patterns = exclude_patterns,
mode = "format",
)
addlicense(
name = "addlicense_check",
copyright_holder = "Tulip Solutions B.V.",
exclude_patterns = exclude_patterns,
mode = "check",
)
gofmt(
name = "gofmt_format",
exclude_patterns = exclude_patterns,
)
gofmt(
name = "gofmt_check",
exclude_patterns = exclude_patterns,
mode = "check",
)
flake8(
name = "flake8_check",
exclude_patterns = exclude_patterns,
)
ktlint(
name = "ktlint_check",
)
ktlint(
name = "ktlint_format",
format = True,
)
intellij_formatter(
name = "intellij_format",
exclude_patterns = exclude_patterns,
)
intellij_formatter(
name = "intellij_check",
exclude_patterns = exclude_patterns,
mode = "check",
)