FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bazel + Gazelle support by patrickt · Pull Request #428 · github/codeql-go · GitHub

Bazel + Gazelle support by patrickt · Pull Request #428 · github/codeql-go · GitHub
Skip to content

Navigation Menu

Sign in
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .bazel  (241) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
  • BUILD.bazel
          • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                    • BUILD.bazel
                    • BUILD.bazel
            • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
              • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                    • BUILD.bazel
                  • BUILD.bazel
                    • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
              • BUILD.bazel
            • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
            • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                  • BUILD.bazel
                • BUILD.bazel
                • BUILD.bazel
          • BUILD.bazel
              • BUILD.bazel
              • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
            • BUILD.bazel
          • BUILD.bazel
          • BUILD.bazel
          • BUILD.bazel
45 changes: 45 additions & 0 deletions BUILD.bazel
This file contains hidden or 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,45 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("//:common.bzl", "get_codeql_arch", "pack_exe_zip", "pack_zip")

# gazelle:prefix github.com/github/codeql-go
gazelle(name = "gazelle")

pack_zip(
name = "dist",
srcs = glob([
"codeql-tools/**",
"ql/src/*.dbscheme*",
"codeql-extractor.yml",
"LICENSE",
]),
out = "pack-codeql-extractor-go.zip",
language = "go",
rewrite_prefixes = {
"language-packs/go/codeql-tools": "go/tools",
"language-packs/go/ql/src": "go",
},
visibility = ["//visibility:public"],
)

pack_exe_zip(
name = "dist-arch",
srcs = [
"//language-packs/go/extractor/cli/go-autobuilder",
"//language-packs/go/extractor/cli/go-bootstrap",
"//language-packs/go/extractor/cli/go-build-runner",
"//language-packs/go/extractor/cli/go-extractor",
"//language-packs/go/extractor/cli/go-gen-dbscheme",
"//language-packs/go/extractor/cli/go-tokenizer",
],
language = "go",
overrides = {
"go-autobuilder": "",
"go-bootstrap": "",
"go-build-runner": "",
"go-extractor": "",
"go-gen-dbscheme": "",
"go-tokenizer": "",
},
platform = get_codeql_arch(),
visibility = ["//visibility:public"],
)
20 changes: 20 additions & 0 deletions extractor/BUILD.bazel
This file contains hidden or 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,20 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "extractor",
srcs = [
"extractor.go",
"gomodextractor.go",
"semaphore.go",
],
importpath = "github.com/github/codeql-go/extractor",
visibility = ["//visibility:public"],
deps = [
"//language-packs/go/extractor/dbscheme",
"//language-packs/go/extractor/srcarchive",
"//language-packs/go/extractor/trap",
"//language-packs/go/extractor/util",
"//language-packs/go/vendor/golang.org/x/mod/modfile",
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
],
)
9 changes: 9 additions & 0 deletions extractor/autobuilder/BUILD.bazel
This file contains hidden or 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,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "autobuilder",
srcs = ["autobuilder.go"],
importpath = "github.com/github/codeql-go/extractor/autobuilder",
visibility = ["//visibility:public"],
deps = ["//language-packs/go/extractor/util"],
)
25 changes: 25 additions & 0 deletions extractor/cli/go-autobuilder/BUILD.bazel
This file contains hidden or 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,25 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
name = "go-autobuilder_lib",
srcs = ["go-autobuilder.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-autobuilder",
visibility = ["//visibility:private"],
deps = [
"//language-packs/go/extractor/autobuilder",
"//language-packs/go/extractor/util",
"//language-packs/go/vendor/golang.org/x/mod/semver",
],
)

go_binary(
name = "go-autobuilder",
embed = [":go-autobuilder_lib"],
visibility = ["//visibility:public"],
)

go_test(
name = "go-autobuilder_test",
srcs = ["go-autobuilder_test.go"],
embed = [":go-autobuilder_lib"],
)
14 changes: 14 additions & 0 deletions extractor/cli/go-bootstrap/BUILD.bazel
This file contains hidden or 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,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "go-bootstrap_lib",
srcs = ["go-bootstrap.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-bootstrap",
visibility = ["//visibility:private"],
)

go_binary(
name = "go-bootstrap",
embed = [":go-bootstrap_lib"],
visibility = ["//visibility:public"],
)
18 changes: 18 additions & 0 deletions extractor/cli/go-build-runner/BUILD.bazel
This file contains hidden or 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,18 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "go-build-runner_lib",
srcs = ["go-build-runner.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-build-runner",
visibility = ["//visibility:private"],
deps = [
"//language-packs/go/extractor/autobuilder",
"//language-packs/go/extractor/util",
],
)

go_binary(
name = "go-build-runner",
embed = [":go-build-runner_lib"],
visibility = ["//visibility:public"],
)
15 changes: 15 additions & 0 deletions extractor/cli/go-extractor/BUILD.bazel
This file contains hidden or 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,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "go-extractor_lib",
srcs = ["go-extractor.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-extractor",
visibility = ["//visibility:private"],
deps = ["//language-packs/go/extractor"],
)

go_binary(
name = "go-extractor",
embed = [":go-extractor_lib"],
visibility = ["//visibility:public"],
)
15 changes: 15 additions & 0 deletions extractor/cli/go-gen-dbscheme/BUILD.bazel
This file contains hidden or 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,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "go-gen-dbscheme_lib",
srcs = ["go-gen-dbscheme.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-gen-dbscheme",
visibility = ["//visibility:private"],
deps = ["//language-packs/go/extractor/dbscheme"],
)

go_binary(
name = "go-gen-dbscheme",
embed = [":go-gen-dbscheme_lib"],
visibility = ["//visibility:public"],
)
14 changes: 14 additions & 0 deletions extractor/cli/go-tokenizer/BUILD.bazel
This file contains hidden or 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,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "go-tokenizer_lib",
srcs = ["go-tokenizer.go"],
importpath = "github.com/github/codeql-go/extractor/cli/go-tokenizer",
visibility = ["//visibility:private"],
)

go_binary(
name = "go-tokenizer",
embed = [":go-tokenizer_lib"],
visibility = ["//visibility:public"],
)
15 changes: 15 additions & 0 deletions extractor/dbscheme/BUILD.bazel
This file contains hidden or 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,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "dbscheme",
srcs = [
"dbscheme.go",
"tables.go",
],
importpath = "github.com/github/codeql-go/extractor/dbscheme",
visibility = ["//visibility:public"],
deps = [
"//language-packs/go/extractor/trap",
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
],
)
17 changes: 17 additions & 0 deletions extractor/srcarchive/BUILD.bazel
This file contains hidden or 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,17 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "srcarchive",
srcs = [
"projectlayout.go",
"srcarchive.go",
],
importpath = "github.com/github/codeql-go/extractor/srcarchive",
visibility = ["//visibility:public"],
)

go_test(
name = "srcarchive_test",
srcs = ["projectlayout_test.go"],
embed = [":srcarchive"],
)
22 changes: 22 additions & 0 deletions extractor/trap/BUILD.bazel
This file contains hidden or 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,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "trap",
srcs = [
"labels.go",
"trapwriter.go",
"util.go",
],
importpath = "github.com/github/codeql-go/extractor/trap",
visibility = ["//visibility:public"],
deps = [
"//language-packs/go/extractor/srcarchive",
"//language-packs/go/vendor/golang.org/x/tools/go/packages",
],
)

go_test(
name = "trap_test",
srcs = ["trapwriter_test.go"],
embed = [":trap"],
)
8 changes: 8 additions & 0 deletions extractor/util/BUILD.bazel
This file contains hidden or 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,8 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "util",
srcs = ["util.go"],
importpath = "github.com/github/codeql-go/extractor/util",
visibility = ["//visibility:public"],
)
26 changes: 26 additions & 0 deletions ql/src/InconsistentCode/BUILD.bazel
This file contains hidden or 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,26 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "InconsistentCode_lib",
srcs = [
"ConstantLengthComparison.go",
"ConstantLengthComparisonGood.go",
"InconsistentLoopOrientation.go",
"InconsistentLoopOrientationGood.go",
"LengthComparisonOffByOne.go",
"LengthComparisonOffByOneGood.go",
"MissingErrorCheck.go",
"MissingErrorCheckGood.go",
"MistypedExponentiation.go",
"WhitespaceContradictsPrecedence.go",
"WhitespaceContradictsPrecedenceGood.go",
],
importpath = "github.com/github/codeql-go/ql/src/InconsistentCode",
visibility = ["//visibility:private"],
)

go_binary(
name = "InconsistentCode",
embed = [":InconsistentCode_lib"],
visibility = ["//visibility:public"],
)
45 changes: 45 additions & 0 deletions ql/src/RedundantCode/BUILD.bazel
This file contains hidden or 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,45 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "RedundantCode_lib",
srcs = [
"CompareIdenticalValues.go",
"CompareIdenticalValuesGood.go",
"DeadStoreOfField.go",
"DeadStoreOfFieldGood.go",
"DeadStoreOfLocalBad.go",
"DeadStoreOfLocalGood.go",
"DuplicateBranches.go",
"DuplicateBranchesGood.go",
"DuplicateCondition.go",
"DuplicateConditionGood.go",
"DuplicateSwitchCase.go",
"DuplicateSwitchCaseGood.go",
"ExprHasNoEffect.go",
"ExprHasNoEffectGood.go",
"ImpossibleInterfaceNilCheck.go",
"ImpossibleInterfaceNilCheckGood.go",
"NegativeLengthCheck.go",
"NegativeLengthCheckGood.go",
"RedundantExpr.go",
"RedundantExprGood.go",
"RedundantRecover1.go",
"RedundantRecover1Good.go",
"RedundantRecover2.go",
"RedundantRecover2Good.go",
"SelfAssignment.go",
"SelfAssignmentGood.go",
"ShiftOutOfRange.go",
"ShiftOutOfRangeGood.go",
"UnreachableStatement.go",
"UnreachableStatementGood.go",
],
importpath = "github.com/github/codeql-go/ql/src/RedundantCode",
visibility = ["//visibility:private"],
)

go_binary(
name = "RedundantCode",
embed = [":RedundantCode_lib"],
visibility = ["//visibility:public"],
)
23 changes: 23 additions & 0 deletions ql/src/Security/CWE-020/BUILD.bazel
This file contains hidden or 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,23 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "CWE-020_lib",
srcs = [
"IncompleteHostnameRegexp.go",
"IncompleteHostnameRegexpGood.go",
"IncompleteUrlSchemeCheck.go",
"IncompleteUrlSchemeCheckGood.go",
"MissingRegexpAnchor.go",
"MissingRegexpAnchorGood.go",
"SuspiciousCharacterInRegexp.go",
"SuspiciousCharacterInRegexpGood.go",
],
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-020",
visibility = ["//visibility:private"],
)

go_binary(
name = "CWE-020",
embed = [":CWE-020_lib"],
visibility = ["//visibility:public"],
)
18 changes: 18 additions & 0 deletions ql/src/Security/CWE-022/BUILD.bazel
This file contains hidden or 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,18 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "CWE-022_lib",
srcs = [
"TaintedPath.go",
"ZipSlip.go",
"ZipSlipGood.go",
],
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-022",
visibility = ["//visibility:private"],
)

go_binary(
name = "CWE-022",
embed = [":CWE-022_lib"],
visibility = ["//visibility:public"],
)
14 changes: 14 additions & 0 deletions ql/src/Security/CWE-078/BUILD.bazel
This file contains hidden or 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,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "CWE-078_lib",
srcs = ["CommandInjection.go"],
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-078",
visibility = ["//visibility:private"],
)

go_binary(
name = "CWE-078",
embed = [":CWE-078_lib"],
visibility = ["//visibility:public"],
)
17 changes: 17 additions & 0 deletions ql/src/Security/CWE-079/BUILD.bazel
This file contains hidden or 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,17 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "CWE-079_lib",
srcs = [
"ReflectedXss.go",
"ReflectedXssGood.go",
],
importpath = "github.com/github/codeql-go/ql/src/Security/CWE-079",
visibility = ["//visibility:private"],
)

go_binary(
name = "CWE-079",
embed = [":CWE-079_lib"],
visibility = ["//visibility:public"],
)
Loading

Footer

© 2026 GitHub, Inc.

Back | FazBrowse Home | New Git URL