-
Notifications
You must be signed in to change notification settings - Fork 85
/
BUILD
125 lines (114 loc) · 2.7 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
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
123
124
125
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@rules_python//python:defs.bzl", "py_library")
# See the note in __init__.py for why this is needed.
py_library(
name = "py_init_shim",
testonly = 1,
srcs = ["__init__.py"],
visibility = ["//tools:__subpackages__"],
)
# Release
exports_files(["MODULE.bazel"])
genrule(
name = "release_MODULE.bazel",
srcs = ["MODULE.bazel"],
outs = ["MODULE.release.bazel"],
cmd = """\
set -euo pipefail
perl -0777 -pe 's/\n# Non-release dependencies.*//s' $< > $@
""",
tags = ["manual"],
)
filegroup(
name = "release_files",
srcs = [
"LICENSE",
":release_MODULE.bazel",
"//tools:release_files",
"//xcodeproj:release_files",
],
tags = ["manual"],
visibility = ["//distribution:__subpackages__"],
)
# Buildifier
_BUILDIFIER_EXCLUDE_PATTERNS = [
"./.git/*",
"./xcodeproj/internal/templates/*",
"./test/fixtures/**/generated/*",
"**/bazel-output-base/*",
"**/test/fixtures/generated/*",
"**/.rules_xcodeproj/*",
"**/*.xcodeproj/*",
]
_BUILDIFIER_WARNINGS = [
"attr-cfg",
"attr-non-empty",
"attr-output-default",
"attr-single-file",
"build-args-kwargs",
"bzl-visibility",
"confusing-name",
"constant-glob",
"ctx-actions",
"ctx-args",
"deprecated-function",
"depset-items",
"depset-iteration",
"depset-union",
"dict-concatenation",
"dict-method-named-arg",
"duplicated-name",
"filetype",
"function-docstring",
"function-docstring-args",
"function-docstring-header",
"function-docstring-return",
"git-repository",
"http-archive",
"integer-division",
"keyword-positional-params",
"list-append",
"load",
"load-on-top",
"module-docstring",
"name-conventions",
"native-py",
"no-effect",
"out-of-order-load",
"output-group",
"overly-nested-depset",
"package-name",
"package-on-top",
"positional-args",
"print",
"provider-params",
"redefined-variable",
"repository-name",
"return-value",
"rule-impl-return",
"same-origin-load",
"skylark-comment",
"skylark-docstring",
"string-iteration",
"uninitialized",
"unnamed-macro",
"unreachable",
"unsorted-dict-items",
"unused-variable",
]
buildifier(
name = "buildifier.check",
exclude_patterns = _BUILDIFIER_EXCLUDE_PATTERNS,
lint_mode = "warn",
lint_warnings = _BUILDIFIER_WARNINGS,
mode = "diff",
tags = ["manual"],
)
buildifier(
name = "buildifier.fix",
exclude_patterns = _BUILDIFIER_EXCLUDE_PATTERNS,
lint_mode = "fix",
lint_warnings = _BUILDIFIER_WARNINGS,
mode = "fix",
tags = ["manual"],
)