Skip to content

fix: align biome init and formatter ownership#205

Merged
zeitlinger merged 3 commits intomainfrom
fix/prettier-biome-ownership
Apr 23, 2026
Merged

fix: align biome init and formatter ownership#205
zeitlinger merged 3 commits intomainfrom
fix/prettier-biome-ownership

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

Summary

  • generate biome.json with explicit space indentation during flint init
  • keep Prettier full-mode scoped to its declared Markdown/YAML patterns
  • add an e2e regression for the biome.jsonc formatter ownership conflict

Testing

  • cargo test fix_exits_nonzero_when_formatters_disagree_on_same_file --test e2e -- --nocapture
  • FLINT_CASES=prettier cargo test cases

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger requested a review from a team as a code owner April 22, 2026 04:57
Copilot AI review requested due to automatic review settings April 22, 2026 04:57
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 adjusts formatter “ownership” so Biome and Prettier don’t both try to format the same files, while also ensuring flint init generates a Biome config that matches the repo’s space-indentation style.

Changes:

  • Generate a biome.json with explicit 2-space indentation during flint init when Biome is selected and no Biome config exists.
  • Remove Prettier’s project-wide --full command so full-mode remains scoped to its declared *.md/*.yml/*.yaml patterns.
  • Add an e2e regression test covering the Prettier-vs-Biome formatter ownership conflict on biome.jsonc.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/e2e.rs Adds an e2e regression ensuring --full Prettier doesn’t target Biome-owned JSONC and that fix exits non-zero on disagreement.
tests/cases/general/init-rust/test.toml Updates the init snapshot to expect biome.json generation and its contents.
src/registry/checks.rs Removes Prettier’s full_cmd so full-mode doesn’t run against {ROOT}.
src/init/mod.rs Detects Biome selection and triggers Biome config generation; adds unit tests for the new generator.
src/init/generation.rs Implements generate_biome_config() to write biome.json with explicit space indentation.

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

Comment thread tests/e2e.rs
Comment thread tests/e2e.rs Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger enabled auto-merge (squash) April 22, 2026 05:57
Comment thread src/init/generation.rs Outdated
@zeitlinger zeitlinger force-pushed the fix/prettier-biome-ownership branch from 6fec4a0 to 94dc658 Compare April 22, 2026 12:38
## Summary
- split init grouping from `--fast-only` behavior by introducing a
separate run policy
- mark `renovate-deps` as adaptive and only run it in `--fast-only` when
the change set is relevant
- add unit and e2e coverage for the renovate relevance gate, and ignore
the local `.cache/` dir

## Testing
- `mise exec -- cargo test -q`
- `mise run lint:fix`
@zeitlinger zeitlinger merged commit ea06f64 into main Apr 23, 2026
13 checks passed
@zeitlinger zeitlinger deleted the fix/prettier-biome-ownership branch April 23, 2026 10:33
@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>
zeitlinger added a commit to grafana/otel-checker that referenced this pull request Apr 27, 2026
Blocked by grafana/flint#205

## Summary

- Replaces super-linter Docker-based linting with the
[flint](https://github.com/grafana/flint) binary
- Adds native linting tools to `mise.toml`: shellcheck, shfmt,
actionlint, editorconfig-checker, prettier, markdownlint-cli2, codespell
(+ gofmt via existing `go` tool)
- Removes `lint:super-linter`, `lint:links`, `lint:renovate-deps` bash
tasks; replaces with `flint run`
- Adds `.github/config/flint.toml` (exclude patterns, renovate-deps
config)
- Adds `.markdownlint.jsonc` with MD013 disabled

## Test plan

- [ ] CI passes (flint run + golangci-lint)
- [ ] `mise run lint` runs clean locally
- [ ] `mise run lint:fix` auto-fixes issues

---------

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.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