Skip to content

Commit 10d727e

Browse files
authored
chore: bazel file linter is applied in ci (magma#12143)
* chore: bazel file linter is applied in ci Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore: bazel formatting issues are fixed Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
1 parent 0a33a56 commit 10d727e

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

.github/workflows/bazel.yml

+9
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,12 @@ jobs:
185185
run: |
186186
cd /workspaces/magma
187187
bazel test //... --test_output=errors --cache_test_results=no
188+
- name: Run `bazel run //:check_starlark_format`
189+
uses: addnab/docker-run-action@v2
190+
with:
191+
image: ${{ env.DEVCONTAINER_IMAGE }}
192+
# TODO: Remove work-around mount of Github workspace to /magma (https://github.com/addnab/docker-run-action/issues/11)
193+
options: -v ${{ github.workspace }}:/workspaces/magma/
194+
run: |
195+
cd /workspaces/magma
196+
bazel run //:check_starlark_format

BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ buildifier_test(
2525
timeout = "short",
2626
srcs = ["//:starlark_files"],
2727
lint_mode = "warn",
28-
lint_warnings = ["all"],
28+
lint_warnings = ["-unused-variable"],
2929
verbose = True,
3030
)
3131

bazel/cpp_repositories.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def cpp_repositories():
6969
commit = "d8326b2bba945a435f299e7526c403d7a1f68c1f",
7070
remote = "https://github.com/jupp0r/prometheus-cpp.git",
7171
shallow_since = "1485901529 +0100",
72-
repo_mapping = {"@protobuf" : "@com_google_protobuf"},
72+
repo_mapping = {"@protobuf": "@com_google_protobuf"},
7373
)
7474

7575
# cpp_redis dependency

bazel/go_repositories.bzl

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1+
# Copyright 2021 The Magma Authors.
2+
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
""" Load external go repositories. """
13+
114
load("@bazel_gazelle//:deps.bzl", "go_repository")
215

316
def go_repositories():
17+
""" Declares all go dependencies. """
18+
419
go_repository(
520
name = "co_honnef_go_tools",
621
importpath = "honnef.co/go/tools",

orc8r/gateway/c/common/config/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ cc_library(
3232
strip_include_prefix = "/orc8r/gateway/c/common/config",
3333
deps = [
3434
"//orc8r/gateway/c/common/logging",
35-
"@github_nlohmann_json//:json",
3635
"@com_google_protobuf//:protobuf",
36+
"@github_nlohmann_json//:json",
3737
],
3838
)
3939

0 commit comments

Comments
 (0)