fix: produce facts of required analyzers in nogo facts-only mode (#4615)
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
In facts-only compiles (packages outside the nogo `includes`, which
includes every external repository), nogo keeps an analyzer only if it
declares `FactTypes` itself:
```go
if !factsOnly || len(a.FactTypes) > 0 {
```
Analyzers whose facts are produced by a *required* sub-analyzer are
dropped entirely, so their requirement closure never runs and downstream
packages never see those facts. The common shape is a checker that
requires a fact-exporting analyzer: staticcheck's SA1019 (use of
deprecated identifiers) requires its deprecation fact analyzer and
declares no fact types of its own, so deprecation facts are never
produced for external repositories and uses of deprecated third-party
APIs in the main repository are silently missed. Analyzers like `printf`
are unaffected only because they happen to declare their fact type
directly.
This PR keeps an analyzer in facts-only mode when anything in its
requirement closure declares fact types, which matches the intent of the
existing comment ("all analyzers that don't generated facts can be
skipped").
Verified against a large monorepo by patching its rules_go: with the
fix, SA1019 immediately reported uses of deprecated identifiers declared
in external module dependencies that were silently missed before, while
external packages themselves still produced no diagnostics.
**Which issues(s) does this PR fix?**
No existing issue that I could find; happy to file one if preferred.
**Other notes for review**
The new `tests/core/nogo/bzlmod/facts_only_test.go` pins the behavior
with a pair of custom analyzers mirroring the deprecation shape: the
fact producer is only required, the nogo-registered analyzer declares no
fact types, and the marked function is declared in a package outside the
nogo `includes`. The first test fails without the `nogo_main.go` change
and passes with it; the second checks that facts-only compiles still
report no diagnostics of their own.
Fixes #46164 files changed