Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: add skywalking-eyes into bazel #40788

Merged
merged 11 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/misc.yml

This file was deleted.

90 changes: 84 additions & 6 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def go_deps():
sum = "h1:PHhrh5ANKFWRBh7TdYmyyq2gyT2lotnvFvvFbylF81Q=",
version = "v0.1.1",
)
go_repository(
name = "com_github_apache_skywalking_eyes",
build_file_proto_mode = "disable",
importpath = "github.com/apache/skywalking-eyes",
sum = "h1:O13kdRU6FCEZevfD01mdhTgCZLLfPZIQ0GXZrLl7FpQ=",
version = "v0.4.0",
)

go_repository(
name = "com_github_apache_thrift",
Expand Down Expand Up @@ -337,6 +344,14 @@ def go_deps():
sum = "h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M=",
version = "v0.8.0",
)
go_repository(
name = "com_github_bmatcuk_doublestar_v2",
build_file_proto_mode = "disable",
importpath = "github.com/bmatcuk/doublestar/v2",
sum = "h1:6I6oUiT/sU27eE2OFcWqBhL1SwjyvQuOssxT4a1yidI=",
version = "v2.0.4",
)

go_repository(
name = "com_github_bombsimon_wsl_v3",
build_file_proto_mode = "disable",
Expand Down Expand Up @@ -1090,8 +1105,8 @@ def go_deps():
name = "com_github_frankban_quicktest",
build_file_proto_mode = "disable_global",
importpath = "github.com/frankban/quicktest",
sum = "h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=",
version = "v1.11.3",
sum = "h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=",
version = "v1.14.3",
)
go_repository(
name = "com_github_fsnotify_fsnotify",
Expand Down Expand Up @@ -1667,12 +1682,20 @@ def go_deps():
sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=",
version = "v0.5.9",
)
go_repository(
name = "com_github_google_go_github_v33",
build_file_proto_mode = "disable",
importpath = "github.com/google/go-github/v33",
sum = "h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM=",
version = "v33.0.0",
)

go_repository(
name = "com_github_google_go_querystring",
build_file_proto_mode = "disable_global",
importpath = "github.com/google/go-querystring",
sum = "h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=",
version = "v1.0.0",
sum = "h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=",
version = "v1.1.0",
)
go_repository(
name = "com_github_google_gofuzz",
Expand All @@ -1681,6 +1704,14 @@ def go_deps():
sum = "h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=",
version = "v1.1.0",
)
go_repository(
name = "com_github_google_licensecheck",
build_file_proto_mode = "disable",
importpath = "github.com/google/licensecheck",
sum = "h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs=",
version = "v0.3.1",
)

go_repository(
name = "com_github_google_martian",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -2051,6 +2082,14 @@ def go_deps():
sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=",
version = "v1.0.0",
)
go_repository(
name = "com_github_huandu_xstrings",
build_file_proto_mode = "disable",
importpath = "github.com/huandu/xstrings",
sum = "h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs=",
version = "v1.3.1",
)

go_repository(
name = "com_github_hydrogen18_memlistener",
build_file_proto_mode = "disable_global",
Expand All @@ -2072,6 +2111,14 @@ def go_deps():
sum = "h1:uGg2frlt3IcT7kbV6LEp5ONv4vmoO2FW4qSO+my/aoM=",
version = "v0.0.0-20210905161508-09a460cdf81d",
)
go_repository(
name = "com_github_imdario_mergo",
build_file_proto_mode = "disable",
importpath = "github.com/imdario/mergo",
sum = "h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=",
version = "v0.3.11",
)

go_repository(
name = "com_github_imkira_go_interpol",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -2667,13 +2714,36 @@ def go_deps():
sum = "h1:GJY4wlzQhuBusMF1oahQCBtUV/AQ/k69IZ68vxaac2Q=",
version = "v1.1.0",
)
go_repository(
name = "com_github_masterminds_goutils",
build_file_proto_mode = "disable",
importpath = "github.com/Masterminds/goutils",
sum = "h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=",
version = "v1.1.1",
)

go_repository(
name = "com_github_masterminds_semver",
build_file_proto_mode = "disable",
importpath = "github.com/Masterminds/semver",
sum = "h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=",
version = "v1.5.0",
)
go_repository(
name = "com_github_masterminds_semver_v3",
build_file_proto_mode = "disable",
importpath = "github.com/Masterminds/semver/v3",
sum = "h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=",
version = "v3.1.1",
)
go_repository(
name = "com_github_masterminds_sprig_v3",
build_file_proto_mode = "disable",
importpath = "github.com/Masterminds/sprig/v3",
sum = "h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8=",
version = "v3.2.2",
)

go_repository(
name = "com_github_matoous_godox",
build_file_proto_mode = "disable",
Expand Down Expand Up @@ -2807,6 +2877,14 @@ def go_deps():
sum = "h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=",
version = "v1.0.0",
)
go_repository(
name = "com_github_mitchellh_copystructure",
build_file_proto_mode = "disable",
importpath = "github.com/mitchellh/copystructure",
sum = "h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=",
version = "v1.0.0",
)

go_repository(
name = "com_github_mitchellh_go_homedir",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -3668,8 +3746,8 @@ def go_deps():
name = "com_github_shopspring_decimal",
build_file_proto_mode = "disable",
importpath = "github.com/shopspring/decimal",
sum = "h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=",
version = "v0.0.0-20180709203117-cd690d0c9e24",
sum = "h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=",
version = "v1.2.0",
)

go_repository(
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dev: checklist check explaintest gogenerate br_unit_test test_part_parser_dev ut
# Install the check tools.
check-setup:tools/bin/revive

check: parser_yacc check-parallel lint tidy testSuite errdoc check-bazel-prepare
check: parser_yacc check-parallel lint tidy testSuite errdoc license check-bazel-prepare

fmt:
@echo "gofmt (simplify)"
Expand All @@ -56,6 +56,12 @@ lint:tools/bin/revive
@echo "linting"
@tools/bin/revive -formatter friendly -config tools/check/revive.toml $(FILES_TIDB_TESTS)

license:
bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) \
--run_under="cd $(CURDIR) && " \
@com_github_apache_skywalking_eyes//cmd/license-eye:license-eye --run_under="cd $(CURDIR) && " -- -c ./.github/licenserc.yml header check


tidy:
@echo "go mod tidy"
./tools/check/check-tidy.sh
Expand Down
9 changes: 9 additions & 0 deletions build/linter/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "linter",
srcs = ["linter.go"],
importpath = "github.com/pingcap/tidb/build/linter",
visibility = ["//visibility:public"],
deps = ["@com_github_apache_skywalking_eyes//pkg/config"],
)
20 changes: 20 additions & 0 deletions build/linter/linter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package linter

import (
// it is necessary to make skywalking-eye into gomod.
_ "github.com/apache/skywalking-eyes/pkg/config"
)
Loading