-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: enable nogo to use fast incremental linter
Signed-off-by: Weizhen Wang <[email protected]>
- Loading branch information
1 parent
4fc9551
commit 386b3f9
Showing
5 changed files
with
281 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,49 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "all_patches", | ||
srcs = glob(["*.patch"]), | ||
visibility = ["//visibility:public"], | ||
load("@io_bazel_rules_go//go:def.bzl", "nogo") | ||
|
||
nogo( | ||
name = "tidb_nogo", | ||
config = ":nogo_config.json", | ||
visibility = ["//visibility:public"], # must have public visibility | ||
deps = [ | ||
# https://github.com/golang/go/issues/48525 | ||
# "@com_github_timakin_bodyclose//passes/bodyclose:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/assign:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/atomic:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/atomicalign:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/bools:go_default_library", | ||
# https://github.com/golang/go/issues/48525 | ||
# "@org_golang_x_tools//go/analysis/passes/buildssa:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/buildtag:go_default_library", | ||
# https://github.com/bazelbuild/rules_go/issues/2396 | ||
# "@org_golang_x_tools//go/analysis/passes/cgocall:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/composite:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/copylock:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/ctrlflow:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/findcall:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/httpresponse:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/ifaceassert:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/inspect:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/loopclosure:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/lostcancel:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/nilfunc:go_default_library", | ||
#"@org_golang_x_tools//go/analysis/passes/nilness:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/pkgfact:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/printf:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/shift:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/sortslice:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/stdmethods:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/stringintconv:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/structtag:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/testinggoroutine:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/tests:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/unmarshal:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/unreachable:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/unsafeptr:go_default_library", | ||
"@org_golang_x_tools//go/analysis/passes/unusedresult:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("@bazel_gazelle//:deps.bzl", "go_repository") | ||
|
||
def nogo_deps(): | ||
go_repository( | ||
name = "com_github_gostaticanalysis_analysisutil", | ||
importpath = "github.com/gostaticanalysis/analysisutil", | ||
sum = "h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk=", | ||
version = "v0.7.1", | ||
) | ||
go_repository( | ||
name = "com_github_gostaticanalysis_comment", | ||
importpath = "github.com/gostaticanalysis/comment", | ||
sum = "h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q=", | ||
version = "v1.4.2", | ||
) | ||
go_repository( | ||
name = "com_github_timakin_bodyclose", | ||
importpath = "github.com/timakin/bodyclose", | ||
sum = "h1:kl4KhGNsJIbDHS9/4U9yQo1UcPQM0kOMJHn29EoH/Ro=", | ||
version = "v0.0.0-20210704033933-f49887972144", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
{ | ||
"asmdecl": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"assign": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"atomic": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"atomicalign": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"bodyclose": { | ||
"exclude_files": { | ||
"external/": "no need to vet third party code" | ||
} | ||
}, | ||
"bools": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"buildtag": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"printf": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"unreachable": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"composites": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code", | ||
"br/pkg/glue/console_glue_test.go": "ignore code", | ||
"br/pkg/restore/db_test.go": "ignore code", | ||
".*_/testmain\\.go$": "ignore code" | ||
} | ||
}, | ||
"copylocks": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code", | ||
"/cgo/": "ignore cgo code" | ||
} | ||
}, | ||
"ctrlflow": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"deepequalerrors": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"errorsas": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"findcall": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"httpresponse": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"ifaceassert": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"inspect": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"loopclosure": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"lostcancel": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"nilfunc": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"nilness": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"pkgfact": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"shift": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"sortslice": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"stdmethods": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"stringintconv": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"structtag": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"testinggoroutine": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"tests": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"unmarshal": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code" | ||
} | ||
}, | ||
"unsafeptr": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code", | ||
"parser/digester.go": "ignore code" | ||
} | ||
}, | ||
"unusedresult": { | ||
"exclude_files": { | ||
"/external/": "no need to vet third party code", | ||
".*_generated\\.go$": "ignore generated code", | ||
"parser/digester_test.go": "ignore code" | ||
} | ||
} | ||
} |