Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel: perform staticcheck checks in
nogo
Add a new binary `generate-staticcheck`, part of `dev generate bazel`, that creates a package in `build/bazelutil/staticcheckanalyzers` capturing a single `staticcheck` check. Then we capture the list of analyzers in `build/bazelutil/staticcheckanalyzers/def.bzl` and add all those checks to `nogo`. However, we can't directly use the `Analyzer`s provided by the upstream library, because they report *all* violations regardless of `lint:ignore` directives. In order to address this we add a helper library at `pkg/testutils/lint/passes/staticcheck` that munges the `Analyzer`s to additionally pull the `lint:ignore` directives and ignore any reported diagnostics that correspond to a `lint:ignore`. This follows the example set by https://github.com/sluongng/staticcheck-codegen, but we don't directly use that code, since we need to inject our own stuff and we want to make sure the content here is pinned to the right version of `staticcheck`. We run the `staticcheck` and `simple` [checks](https://staticcheck.io/docs/checks). `stylecheck` is still broken: cockroachdb#73568 Closes cockroachdb#68496. Release note: None
- Loading branch information