SIGN IN SIGN UP

Deprecate legacy hidden flags and retire the optional-checks mechanism (#1119)

* Warn (on stderr) when a deprecated hidden flag is used

--flatten, --max-circular-dep, and --include-checks are hidden legacy
flags kept working for back-compat. They gave no signal to move off them.
Now, when one is actually set, a notice is written to stderr pointing to
the replacement. Stderr, not stdout, because cobra's MarkDeprecated writes
to stdout and corrupts json/yaml output (the reason these are hidden rather
than marked deprecated in the first place).

review-token and review-meta stay untouched: they are hidden because they
are an automation interface for the review upload, not because they are
legacy.

* windows test: use --flatten-allof (not the deprecated --flatten)

The Windows composed-mode test still passed --flatten and asserted exact
stderr; the new deprecation notice broke the match. Same fix as the unix
counterpart.

* Retire the optional-checks mechanism

The optional-checks opt-in (promote a check to ERR via --include-checks) is
superseded by --severity-levels, which does the same for any check. Remove it:

- Delete WithOptionalCheck, WithOptionalChecks, GetOptionalRules,
  GetOptionalRuleIds, and the // optional markers. The six checks
  (response-non-success-status-removed, api-operation-id-removed, api-tag-removed,
  api-schema-removed, response-property-enum-value-removed,
  response-mediatype-enum-value-removed) are now plain INFO checks.
- --include-checks is accepted but ignored (like --max-circular-dep), so existing
  pipelines don't break, and it warns via the deprecation notice pointing to
  --severity-levels.
- Update tests: drop the promotion tests, assert --include-checks is accepted and
  ignored, and restructure the component-ignore test to work at INFO.

* Say --include-checks is now ignored in its deprecation notice

The retirement makes --include-checks a no-op. 'use --severity-levels
instead' didn't convey that enforcement stopped; say it is now ignored and
how to restore the behavior, matching --max-circular-dep's 'is ignored'.
R
Reuven Harrison committed
d2d6031c6df516ba158fa5eb540cf067a84334f4
Parent: d8dca40
Committed by GitHub <noreply@github.com> on 7/25/2026, 10:02:03 AM