Skip to content

fix: expand baseline guards for config and flint changes#215

Merged
zeitlinger merged 2 commits intomainfrom
codex/config-guard-baselines
Apr 23, 2026
Merged

fix: expand baseline guards for config and flint changes#215
zeitlinger merged 2 commits intomainfrom
codex/config-guard-baselines

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 23, 2026

Summary

  • add registry metadata for baseline-trigger config files and unsupported alternate config files
  • fail active checks when a known unsupported upstream config is present
  • treat .editorconfig as a baseline-triggering config for editorconfig-checker
  • expand all active checks when the pinned github:grafana/flint version changes in mise.toml
  • document the baseline expansion behavior in CLI and agent knowledge docs

Validation

  • FLINT_CASES=general/baseline-flint-upgrade cargo test cases
  • mise run lint:fix
  • cargo test -q

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review April 23, 2026 13:23
@zeitlinger zeitlinger requested a review from a team as a code owner April 23, 2026 13:23
Copilot AI review requested due to automatic review settings April 23, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens flint’s linter-config handling by explicitly registering baseline-triggering config files and known unsupported upstream/alternate config locations, then failing early when unsupported configs are detected for active checks.

Changes:

  • Extend registry Check metadata with baseline_configs and unsupported_configs, plus a ConfigFile descriptor for config detection.
  • Add runtime detection: baseline expansion now keys off registered baseline_configs, and flint run hard-fails if an active check’s unsupported_configs are present.
  • Add/extend E2E fixtures and docs to cover canonical-config behavior (including .editorconfig triggering baseline for editorconfig-checker).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/cases/general/unsupported-alternate-config/test.toml Adds an E2E expectation asserting flint fails on an unsupported alternate shellcheck config.
tests/cases/general/unsupported-alternate-config/files/shellcheckrc Fixture for an unsupported shellcheck config filename.
tests/cases/general/unsupported-alternate-config/files/mise.toml Activates shellcheck for the unsupported-config E2E case.
tests/cases/general/unsupported-alternate-config/files/good.sh Provides a simple shell script input for the E2E case.
tests/cases/general/baseline-editorconfig-change/test.toml Adds an E2E expectation verifying .editorconfig changes trigger baseline runs for editorconfig-checker.
tests/cases/general/baseline-editorconfig-change/files/mise.toml Activates editorconfig-checker for the baseline-trigger E2E case.
tests/cases/general/baseline-editorconfig-change/files/hello.txt Fixture file with trailing whitespace to demonstrate baseline-triggered failure.
tests/cases/general/baseline-editorconfig-change/files/.editorconfig Baseline .editorconfig version for the baseline-trigger E2E case.
tests/cases/general/baseline-editorconfig-change/changes/.editorconfig “Changed” .editorconfig used to exercise the baseline expansion path.
src/runner.rs Updates internal test-only Check literals to include the new Check fields.
src/registry/types.rs Introduces baseline_configs / unsupported_configs on Check and adds ConfigFile/ConfigMatch types.
src/registry/mod.rs Re-exports the new config types for use outside the registry module.
src/registry/checks.rs Registers baseline and unsupported config metadata per built-in linter (including .editorconfig for ec).
src/main.rs Implements baseline triggering via baseline_configs and adds early failure on detected unsupported configs.
docs/cli.md Documents baseline triggers beyond the injected config and explains canonical-config enforcement behavior.
.github/agents/knowledge/linters.md Documents how to register baseline vs unsupported configs when adding linters.
.github/agents/knowledge/architecture.md Updates architecture notes to reflect baseline triggers and canonical-config enforcement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger changed the title fix: reject unsupported linter configs fix: expand baseline guards for config and flint changes Apr 23, 2026
@zeitlinger zeitlinger enabled auto-merge (squash) April 23, 2026 13:51
@zeitlinger zeitlinger merged commit 9a95c8c into main Apr 23, 2026
14 checks passed
@zeitlinger zeitlinger deleted the codex/config-guard-baselines branch April 23, 2026 13:57
@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
zeitlinger pushed a commit that referenced this pull request Apr 23, 2026
### Added

- group linter renovate updates
([#209](#209))

### Fixed

- expand baseline guards for config and flint changes
([#215](#215))
- remove stale exclude_paths init placeholder
([#211](#211))
- baseline lint coverage changes
([#214](#214))
- align biome init and formatter ownership
([#205](#205))

### Other

- *(deps)* update dependency npm:renovate to v43.133.0
([#216](#216))
- *(deps)* update dependency npm:renovate to v43.132.2
([#212](#212))
- *(deps)* update taiki-e/install-action digest to 5f57d6c
([#204](#204))
- clarify that flint init works with existing mise.toml
([#208](#208))
- guard against overlapping fixer ownership
([#206](#206))

> [!IMPORTANT]
> Close and reopen this PR to trigger CI checks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants