loadNativePluginConfig function

void loadNativePluginConfig()

Loads all plugin configuration from yaml and environment variables. Order matters: severity overrides first, then diagnostics (enable/disable), then rule packs (adds enabled rule codes; skips disabledRules), then baseline, banned usage, and output (max_issues, file-only). Safe to call multiple times — static fields are simply overwritten. Never throws; failures in any step are caught and the rest still run.

Implementation

void loadNativePluginConfig() {
  try {
    final content = _readProjectFile('analysis_options_custom.yaml');
    _loadSeverityOverrides(content);
    _loadDiagnosticsConfig();
    _loadRulePacksConfig();
    _loadBaselineConfig(content);
    loadBannedUsageConfig(content);
    _loadOutputConfig(content);
  } catch (e, st) {
    developer.log(
      'loadNativePluginConfig failed',
      name: 'saropa_lints',
      error: e,
      stackTrace: st,
    );
    // Defensive: ensure plugin can still register with defaults
  }
}