tree: 3ce0e8944770c9c782543552a4c971305e1d4638 [path history] [tgz]
  1. analyzers/
  2. cmd/
  6. staticanalysis.go
  7. staticanalysis_test.go

Static Analysis Tools

staticanalysis contains Go wrappers around various static analysis tools (linters, auto-formatters, etc.) to transform their outputs into a consistent format.

staticanalysis and its dependent tools are built using the Fuchsia build system and assumes that it has access to a full Fuchsia checkout and build directory. Although this is subject to change in the future as they may be generalized to work out-of-tree.


The staticlints tool runs selected analyzers in non-blocking mode.

The data emitted by this tool feeds into the LUCI Tricium service that Fuchsia uses to add non-blocking robot comments on pending changes.

Integrating a new tool

If you want to integrate a new static analysis tool called “foofmt”, add a new foofmt.go file in this directory that contains a FooAnalyzer type implementing the Analyzers interface. Then add FooAnalyzer to the list of analyzers run in either staticchecks (if the tool should block presubmit) or staticlints (if the tool should emit non-blocking comments).