bazel-contrib / bazel-contrib/rules_go

Enhance `nogo` to provide warnings and export diagnostics

Open
#4,273 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

## Description
Currently, `nogo` in `rules_go` does not provide warnings or export complete diagnostics per analyzer. This makes it difficult to collect meaningful insights and enforce best practices without failing the build.

## Problem
- `nogo` strictly fails on errors, which prevents collecting non-blocking diagnostics.
- There is no built-in way to aggregate and export detailed diagnostics per analyzer.
- Developers lack visibility into potential issues without breaking the build process.

## Proposed Idea
Instead of failing immediately, we could introduce a mechanism to:
1. **Swallow Errors**: Allow `nogo` to collect and log issues instead of immediately failing.
2. **Collect Metrics**: Aggregate diagnostics from all analyzers and export them in a structured format.
3. **Configurable Behavior**: Allow warnings vs. errors to be configurable per analyzer.

## Questions for Discussion
- Would it make sense to introduce a `warning` mode in `nogo`?
- Should this be built into `rules_go`, or would an external tool be better suited for post-processing?

Contributor guide

Open the contributing guide

Research direction

The issue names nogo and rules_go but no files, tests, or entry points. Start by locating nogo's current diagnostic and failure-handling flow, then review the existing analyzer behavior. Done would require an agreed design for warning modes, aggregation, export format, and per-analyzer configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.