Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Latest commit

 

History

History

gometalinter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

gometalinter

Bazel rule for gometalinter.

Limitations

This rule does not work with:

  • generated Go code
  • with Bazel-managed Go dependencies
  • with Go modules, unless go mod vendor is used

Consider using nogo from rules_go.

Setup and usage via Bazel

You can invoke gometalinter via the Bazel rule.

WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# gometalinter needs Go SDK and hence needs rules_go.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
    name = "io_bazel_rules_go",
)

git_repository(
    name = "com_github_ash2k_bazel_tools",
    commit = "<commit>",
    remote = "https://github.com/ash2k/bazel-tools.git",
    shallow_since = "<bla>",
)

load("@com_github_ash2k_bazel_tools//gometalinter:deps.bzl", "gometalinter_dependencies")

gometalinter_dependencies()

BUILD.bazel typically in the workspace root:

load("@com_github_ash2k_bazel_tools//gometalinter:def.bzl", "gometalinter")

gometalinter(
    name = "gometalinter",
    config = "//:.gometalinter.json",
    paths = [
        ".",
        "cmd/...",
        "pkg/...",
    ],
    prefix = "github.com/<my>/<project>",
)

Invoke with

bazel run //:gometalinter