Skip to content

fix: baseline lint coverage changes#214

Merged
zeitlinger merged 5 commits intomainfrom
codex/baseline-lint-coverage
Apr 23, 2026
Merged

fix: baseline lint coverage changes#214
zeitlinger merged 5 commits intomainfrom
codex/baseline-lint-coverage

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

Summary

Fixes #213.

  • run newly active linters against all matching files once so migrations establish a baseline
  • run affected linters against all files when their config changes
  • distinguish global flint.toml settings changes from per-check special config changes
  • run ShellCheck with -x -P SCRIPTDIR so sourced sibling files resolve correctly
  • add regression fixtures for new-linter, linter-config, global flint settings, and ShellCheck sourced-file cases
  • sync Renovate's linter package grouping with the current registry

Validation

  • FLINT_CASES=general/baseline-flint-settings-change cargo test cases
  • FLINT_CASES=general/baseline-new-linter cargo test cases
  • FLINT_CASES=general/baseline-config-change cargo test cases
  • FLINT_CASES=shellcheck cargo test cases
  • mise run test
  • mise run lint:fix

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review April 23, 2026 12:05
Copilot AI review requested due to automatic review settings April 23, 2026 12:05
@zeitlinger zeitlinger requested a review from a team as a code owner April 23, 2026 12:05
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

Implements baseline lint coverage behavior so that newly-activated linters and linter/config changes trigger a one-time full-file run to establish a consistent baseline (including improving ShellCheck source resolution), and adds regression fixtures to lock in the behavior.

Changes:

  • Add baseline selection logic so newly active linters and relevant config changes run against all matching files once.
  • Update ShellCheck invocation to follow sourced files using -x -P SCRIPTDIR.
  • Add/extend end-to-end regression fixtures for baseline scenarios and ShellCheck sourced-file behavior; update Renovate linter grouping.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cases/shellcheck/sourced-file/test.toml Adds a ShellCheck fixture asserting sourced-file handling succeeds in --full mode.
tests/cases/shellcheck/sourced-file/files/mise.toml Declares ShellCheck tool for the sourced-file fixture repo.
tests/cases/shellcheck/sourced-file/files/docker/run-pyroscope.sh Provides a shell script that sources a sibling file to exercise ShellCheck -x resolution.
tests/cases/shellcheck/sourced-file/files/docker/logging.sh Sourced shell file used by the sourced-file fixture.
tests/cases/general/baseline-new-linter/test.toml Adds fixture asserting a newly enabled linter establishes baseline by scanning all relevant files.
tests/cases/general/baseline-new-linter/files/mise.toml Baseline repo state without the newly enabled linter tool declared.
tests/cases/general/baseline-new-linter/files/bad.sh Introduces a shell script that intentionally fails ShellCheck to validate baseline behavior.
tests/cases/general/baseline-new-linter/changes/mise.toml Enables ShellCheck in the fixture’s “changed” state to simulate a newly activated linter.
tests/cases/general/baseline-flint-settings-change/test.toml Adds fixture for baseline behavior triggered by global flint.toml settings changes.
tests/cases/general/baseline-flint-settings-change/files/mise.toml Declares ShellCheck tool for the settings-change baseline fixture.
tests/cases/general/baseline-flint-settings-change/files/config/flint.toml Fixture flint settings that exclude a failing file initially.
tests/cases/general/baseline-flint-settings-change/files/bad.sh ShellCheck-failing file used to validate settings-change baseline behavior.
tests/cases/general/baseline-flint-settings-change/changes/config/flint.toml Fixture change that updates global settings (exclude list) to trigger a baseline run.
tests/cases/general/baseline-config-change/test.toml Adds fixture for baseline behavior triggered by linter-specific config changes.
tests/cases/general/baseline-config-change/files/mise.toml Declares ShellCheck tool for the linter-config-change fixture.
tests/cases/general/baseline-config-change/files/config/.shellcheckrc Fixture linter config initially disabling SC2086.
tests/cases/general/baseline-config-change/files/bad.sh ShellCheck-failing file used to validate config-change baseline behavior.
tests/cases/general/baseline-config-change/changes/config/.shellcheckrc Fixture change that re-enables SC2086 to trigger baseline behavior.
src/runner.rs Makes RunOptions Copy/Clone to support reuse when partitioning baseline vs normal runs.
src/registry/mod.rs Re-exports read_mise_tools_at_ref for baseline detection logic.
src/registry/mise.rs Adds ability to read mise.toml tool declarations from a git ref (git show).
src/registry/checks.rs Updates ShellCheck command template to shellcheck -x -P SCRIPTDIR {FILE}.
src/main.rs Implements baseline selection logic and routes execution through a helper that runs baseline checks against an all-files list.
src/files.rs Adds files::all() helper and uses it for the --full and “no merge base” fallback paths.
default.json Updates Renovate linter package grouping to match the current tool keys/names.

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

Comment thread src/main.rs
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger enabled auto-merge (squash) April 23, 2026 12:52
@zeitlinger zeitlinger merged commit 9fb53a4 into main Apr 23, 2026
13 checks passed
@zeitlinger zeitlinger deleted the codex/baseline-lint-coverage branch April 23, 2026 12:53
@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.

fix: establish full baselines when lint coverage changes

3 participants