Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 3575134

Browse files
author
Patrick Thomson
committed
Add autogenerated Bazel files and gazelle target.
1 parent 43f9351 commit 3575134

File tree

241 files changed

+3485
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+3485
-0
lines changed

BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
load("@bazel_gazelle//:def.bzl", "gazelle")
2+
3+
# gazelle:prefix github.com/github/codeql-go
4+
gazelle(name = "gazelle")

extractor/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "extractor",
5+
srcs = [
6+
"extractor.go",
7+
"gomodextractor.go",
8+
"semaphore.go",
9+
],
10+
importpath = "github.com/github/codeql-go/extractor",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"//language-packs/go/extractor/dbscheme",
14+
"//language-packs/go/extractor/srcarchive",
15+
"//language-packs/go/extractor/trap",
16+
"//language-packs/go/extractor/util",
17+
"//language-packs/go/vendor/golang.org/x/mod/modfile",
18+
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
19+
],
20+
)

extractor/autobuilder/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "autobuilder",
5+
srcs = ["autobuilder.go"],
6+
importpath = "github.com/github/codeql-go/extractor/autobuilder",
7+
visibility = ["//visibility:public"],
8+
deps = ["//language-packs/go/extractor/util"],
9+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
2+
3+
go_library(
4+
name = "go-autobuilder_lib",
5+
srcs = ["go-autobuilder.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-autobuilder",
7+
visibility = ["//visibility:private"],
8+
deps = [
9+
"//language-packs/go/extractor/autobuilder",
10+
"//language-packs/go/extractor/util",
11+
"//language-packs/go/vendor/golang.org/x/mod/semver",
12+
],
13+
)
14+
15+
go_binary(
16+
name = "go-autobuilder",
17+
embed = [":go-autobuilder_lib"],
18+
visibility = ["//visibility:public"],
19+
)
20+
21+
go_test(
22+
name = "go-autobuilder_test",
23+
srcs = ["go-autobuilder_test.go"],
24+
embed = [":go-autobuilder_lib"],
25+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "go-bootstrap_lib",
5+
srcs = ["go-bootstrap.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-bootstrap",
7+
visibility = ["//visibility:private"],
8+
)
9+
10+
go_binary(
11+
name = "go-bootstrap",
12+
embed = [":go-bootstrap_lib"],
13+
visibility = ["//visibility:public"],
14+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "go-build-runner_lib",
5+
srcs = ["go-build-runner.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-build-runner",
7+
visibility = ["//visibility:private"],
8+
deps = [
9+
"//language-packs/go/extractor/autobuilder",
10+
"//language-packs/go/extractor/util",
11+
],
12+
)
13+
14+
go_binary(
15+
name = "go-build-runner",
16+
embed = [":go-build-runner_lib"],
17+
visibility = ["//visibility:public"],
18+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "go-extractor_lib",
5+
srcs = ["go-extractor.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-extractor",
7+
visibility = ["//visibility:private"],
8+
deps = ["//language-packs/go/extractor"],
9+
)
10+
11+
go_binary(
12+
name = "go-extractor",
13+
embed = [":go-extractor_lib"],
14+
visibility = ["//visibility:public"],
15+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "go-gen-dbscheme_lib",
5+
srcs = ["go-gen-dbscheme.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-gen-dbscheme",
7+
visibility = ["//visibility:private"],
8+
deps = ["//language-packs/go/extractor/dbscheme"],
9+
)
10+
11+
go_binary(
12+
name = "go-gen-dbscheme",
13+
embed = [":go-gen-dbscheme_lib"],
14+
visibility = ["//visibility:public"],
15+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "go-tokenizer_lib",
5+
srcs = ["go-tokenizer.go"],
6+
importpath = "github.com/github/codeql-go/extractor/cli/go-tokenizer",
7+
visibility = ["//visibility:private"],
8+
)
9+
10+
go_binary(
11+
name = "go-tokenizer",
12+
embed = [":go-tokenizer_lib"],
13+
visibility = ["//visibility:public"],
14+
)

extractor/dbscheme/BUILD.bazel

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "dbscheme",
5+
srcs = [
6+
"dbscheme.go",
7+
"tables.go",
8+
],
9+
importpath = "github.com/github/codeql-go/extractor/dbscheme",
10+
visibility = ["//visibility:public"],
11+
deps = [
12+
"//language-packs/go/extractor/trap",
13+
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
14+
],
15+
)

extractor/srcarchive/BUILD.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
2+
3+
go_library(
4+
name = "srcarchive",
5+
srcs = [
6+
"projectlayout.go",
7+
"srcarchive.go",
8+
],
9+
importpath = "github.com/github/codeql-go/extractor/srcarchive",
10+
visibility = ["//visibility:public"],
11+
)
12+
13+
go_test(
14+
name = "srcarchive_test",
15+
srcs = ["projectlayout_test.go"],
16+
embed = [":srcarchive"],
17+
)

extractor/trap/BUILD.bazel

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
2+
3+
go_library(
4+
name = "trap",
5+
srcs = [
6+
"labels.go",
7+
"trapwriter.go",
8+
"util.go",
9+
],
10+
importpath = "github.com/github/codeql-go/extractor/trap",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"//language-packs/go/extractor/srcarchive",
14+
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
15+
],
16+
)
17+
18+
go_test(
19+
name = "trap_test",
20+
srcs = ["trapwriter_test.go"],
21+
embed = [":trap"],
22+
)

extractor/util/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "util",
5+
srcs = ["util.go"],
6+
importpath = "github.com/github/codeql-go/extractor/util",
7+
visibility = ["//visibility:public"],
8+
)

ql/src/InconsistentCode/BUILD.bazel

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "InconsistentCode_lib",
5+
srcs = [
6+
"ConstantLengthComparison.go",
7+
"ConstantLengthComparisonGood.go",
8+
"InconsistentLoopOrientation.go",
9+
"InconsistentLoopOrientationGood.go",
10+
"LengthComparisonOffByOne.go",
11+
"LengthComparisonOffByOneGood.go",
12+
"MissingErrorCheck.go",
13+
"MissingErrorCheckGood.go",
14+
"MistypedExponentiation.go",
15+
"WhitespaceContradictsPrecedence.go",
16+
"WhitespaceContradictsPrecedenceGood.go",
17+
],
18+
importpath = "github.com/github/codeql-go/ql/src/InconsistentCode",
19+
visibility = ["//visibility:private"],
20+
)
21+
22+
go_binary(
23+
name = "InconsistentCode",
24+
embed = [":InconsistentCode_lib"],
25+
visibility = ["//visibility:public"],
26+
)

ql/src/RedundantCode/BUILD.bazel

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "RedundantCode_lib",
5+
srcs = [
6+
"CompareIdenticalValues.go",
7+
"CompareIdenticalValuesGood.go",
8+
"DeadStoreOfField.go",
9+
"DeadStoreOfFieldGood.go",
10+
"DeadStoreOfLocalBad.go",
11+
"DeadStoreOfLocalGood.go",
12+
"DuplicateBranches.go",
13+
"DuplicateBranchesGood.go",
14+
"DuplicateCondition.go",
15+
"DuplicateConditionGood.go",
16+
"DuplicateSwitchCase.go",
17+
"DuplicateSwitchCaseGood.go",
18+
"ExprHasNoEffect.go",
19+
"ExprHasNoEffectGood.go",
20+
"ImpossibleInterfaceNilCheck.go",
21+
"ImpossibleInterfaceNilCheckGood.go",
22+
"NegativeLengthCheck.go",
23+
"NegativeLengthCheckGood.go",
24+
"RedundantExpr.go",
25+
"RedundantExprGood.go",
26+
"RedundantRecover1.go",
27+
"RedundantRecover1Good.go",
28+
"RedundantRecover2.go",
29+
"RedundantRecover2Good.go",
30+
"SelfAssignment.go",
31+
"SelfAssignmentGood.go",
32+
"ShiftOutOfRange.go",
33+
"ShiftOutOfRangeGood.go",
34+
"UnreachableStatement.go",
35+
"UnreachableStatementGood.go",
36+
],
37+
importpath = "github.com/github/codeql-go/ql/src/RedundantCode",
38+
visibility = ["//visibility:private"],
39+
)
40+
41+
go_binary(
42+
name = "RedundantCode",
43+
embed = [":RedundantCode_lib"],
44+
visibility = ["//visibility:public"],
45+
)

ql/src/Security/CWE-020/BUILD.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-020_lib",
5+
srcs = [
6+
"IncompleteHostnameRegexp.go",
7+
"IncompleteHostnameRegexpGood.go",
8+
"IncompleteUrlSchemeCheck.go",
9+
"IncompleteUrlSchemeCheckGood.go",
10+
"MissingRegexpAnchor.go",
11+
"MissingRegexpAnchorGood.go",
12+
"SuspiciousCharacterInRegexp.go",
13+
"SuspiciousCharacterInRegexpGood.go",
14+
],
15+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-020",
16+
visibility = ["//visibility:private"],
17+
)
18+
19+
go_binary(
20+
name = "CWE-020",
21+
embed = [":CWE-020_lib"],
22+
visibility = ["//visibility:public"],
23+
)

ql/src/Security/CWE-022/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-022_lib",
5+
srcs = [
6+
"TaintedPath.go",
7+
"ZipSlip.go",
8+
"ZipSlipGood.go",
9+
],
10+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-022",
11+
visibility = ["//visibility:private"],
12+
)
13+
14+
go_binary(
15+
name = "CWE-022",
16+
embed = [":CWE-022_lib"],
17+
visibility = ["//visibility:public"],
18+
)

ql/src/Security/CWE-078/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-078_lib",
5+
srcs = ["CommandInjection.go"],
6+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-078",
7+
visibility = ["//visibility:private"],
8+
)
9+
10+
go_binary(
11+
name = "CWE-078",
12+
embed = [":CWE-078_lib"],
13+
visibility = ["//visibility:public"],
14+
)

ql/src/Security/CWE-079/BUILD.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-079_lib",
5+
srcs = [
6+
"ReflectedXss.go",
7+
"ReflectedXssGood.go",
8+
],
9+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-079",
10+
visibility = ["//visibility:private"],
11+
)
12+
13+
go_binary(
14+
name = "CWE-079",
15+
embed = [":CWE-079_lib"],
16+
visibility = ["//visibility:public"],
17+
)

ql/src/Security/CWE-089/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-089_lib",
5+
srcs = [
6+
"SqlInjection.go",
7+
"SqlInjectionGood.go",
8+
"StringBreak.go",
9+
"StringBreakGood.go",
10+
],
11+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-089",
12+
visibility = ["//visibility:private"],
13+
deps = ["@com_github_masterminds_squirrel//:go_default_library"],
14+
)
15+
16+
go_binary(
17+
name = "CWE-089",
18+
embed = [":CWE-089_lib"],
19+
visibility = ["//visibility:public"],
20+
)

ql/src/Security/CWE-190/BUILD.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "CWE-190_lib",
5+
srcs = [
6+
"AllocationSizeOverflow.go",
7+
"AllocationSizeOverflowGood.go",
8+
],
9+
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-190",
10+
visibility = ["//visibility:private"],
11+
)
12+
13+
go_binary(
14+
name = "CWE-190",
15+
embed = [":CWE-190_lib"],
16+
visibility = ["//visibility:public"],
17+
)

0 commit comments

Comments
 (0)