sluongng / nogo-analyzer

A collection of common static analyzers (linters) that can be used with Bazel's rules_go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`staticcheck` setup issues with current usage guide

jarreds opened this issue · comments

Step (1) Add to WORKSPACE file:

http_archive(
    name = "com_github_sluongng_nogo_analyzer",
    sha256 = "ab9ab7936b6d490ff92bb8e3e03bc3ace3406f0b4d1625cc0720d0e9e81a369a",
    urls = [
        "https://github.com/sluongng/nogo-analyzer/archive/refs/tags/v0.0.1.tar.gz",
    ],
)

Step (2) Setup deps for staticcheck analyzers in WORKSPACE:

load("//nogo-analyzer/staticcheck:deps.bzl", "staticcheck_deps")

staticcheck_deps()

Error output:

ERROR: error loading package '': Label '//nogo-analyzer/staticcheck:deps.bzl' is invalid because 'nogo-analyzer/staticcheck' is not a package; perhaps you meant to put the colon here: '//:nogo-analyzer/staticcheck/deps.bzl'?

Thanks for letting me know. The instruction was out of date in the doc.
This is the correct usage.

load("@com_github_sluongng_nogo_analyzer//staticcheck:deps.bzl", "staticcheck_deps")

staticcheck_deps()

I have pushed an update to have this in the doc. 🤗