Skip to content

Commit

Permalink
ci: add apilinter
Browse files Browse the repository at this point in the history
Signed-off-by: Artsiom Koltun <[email protected]>
  • Loading branch information
artek-koltun committed Jun 26, 2024
1 parent 2ef12a5 commit db6b7dd
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 8 deletions.
7 changes: 6 additions & 1 deletion inventory/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,11 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

Expand Down
6 changes: 5 additions & 1 deletion network/cloud/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,10 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}/../../network/opinetcommon":/common -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0123 --disable-rule=core::0131 --disable-rule=core::0132 --disable-rule=core::0133 --disable-rule=core::0134 --disable-rule=core::0140 --disable-rule=core::0156 --disable-rule=core::0158 --disable-rule=core::0191 --disable-rule=core::0192 --disable-rule=core::0203 --disable-rule=core::0216 --disable-rule=client-libraries::4232::required-fields --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}":/out -w /out bufbuild/buf lint
Expand Down
7 changes: 6 additions & 1 deletion network/evpn-gw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
# Copyright (C) 2023 Nordix Foundation.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -17,6 +17,11 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}/../../network/opinetcommon":/common -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}":/out -w /out bufbuild/buf lint

Expand Down
6 changes: 5 additions & 1 deletion network/k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,10 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}":/out -w /out bufbuild/buf lint
Expand Down
7 changes: 6 additions & 1 deletion network/opinetcommon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint
Expand Down
6 changes: 5 additions & 1 deletion network/telco/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,10 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}":/out -w /out bufbuild/buf lint
Expand Down
7 changes: 6 additions & 1 deletion security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,11 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192 --disable-rule=core::0191 --disable-rule=core::0140 --disable-rule=core::0123 --disable-rule=core::0142 --disable-rule=core::0126 --disable-rule=core::0127 --disable-rule=core::0141 --disable-rule=core::0203 --disable-rule=core::0216 --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

Expand Down
7 changes: 6 additions & 1 deletion storage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint bufgen doc
all: buflint apilint bufgen doc

doc:
rm -rf ./google
Expand All @@ -16,6 +16,11 @@ doc:

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

Expand Down

0 comments on commit db6b7dd

Please sign in to comment.