From 860b372269e81c23c67d46cb3fda18a633722fd2 Mon Sep 17 00:00:00 2001 From: Leo Farias Date: Wed, 30 Sep 2026 19:19:03 -0400 Subject: [PATCH] Add a mix.yaml preset that enables mix_lint Projects that use Mix can include package:bitwild_analysis/mix.yaml next to plugin.yaml to run Mix's own analyzer plugin alongside bitwild_lints. The analyzer merges plugins declared in separate included files, so each preset declares only its own plugin. mix_lint comes from the Mix repository's main branch until a release that loads alongside bitwild_lints is on pub.dev. Claude-Session: https://claude.ai/code/session_01MvC9knoRVaudEiPhBu758x --- README.md | 2 ++ doc/installing.md | 3 +++ packages/bitwild_analysis/CHANGELOG.md | 4 ++++ packages/bitwild_analysis/README.md | 1 + packages/bitwild_analysis/lib/mix.yaml | 22 ++++++++++++++++++++++ 5 files changed, 32 insertions(+) create mode 100644 packages/bitwild_analysis/lib/mix.yaml diff --git a/README.md b/README.md index ea10907..d61138b 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ workspaces, SDK requirements, overrides, and CI, follow the with its recommended rules. - `plugin_all.yaml`: the same plugin with every rule, including the ordering and formatting conventions. +- `mix.yaml`: adds Mix's own `mix_lint` plugin, for projects that use Mix. + Include it next to `plugin.yaml` or `plugin_all.yaml`. ## Rules diff --git a/doc/installing.md b/doc/installing.md index 2fb9ae2..5db015b 100644 --- a/doc/installing.md +++ b/doc/installing.md @@ -66,6 +66,9 @@ yet they report hundreds to thousands of issues, so start with `plugin.yaml` and switch once the code is ready (see step 6). Include one or the other, not both. +Projects that use Mix can add `package:bitwild_analysis/mix.yaml` to the list +to enable Mix's `mix_lint` plugin as well. Both plugins run together. + On Dart 3.11 or 3.12, drop the `plugin.yaml` line and, if you want the plugin locally, add it by path to a checkout of this repository: diff --git a/packages/bitwild_analysis/CHANGELOG.md b/packages/bitwild_analysis/CHANGELOG.md index 4427fc0..01fcf89 100644 --- a/packages/bitwild_analysis/CHANGELOG.md +++ b/packages/bitwild_analysis/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +- Add `mix.yaml`, which enables the `mix_lint` plugin from the Mix repository. + ## 0.3.0 - Rename the package from `btwld_lints` to `bitwild_analysis`. Update the diff --git a/packages/bitwild_analysis/README.md b/packages/bitwild_analysis/README.md index f2ee0b0..9b274c0 100644 --- a/packages/bitwild_analysis/README.md +++ b/packages/bitwild_analysis/README.md @@ -13,6 +13,7 @@ include: | `dart.yaml` | `package:lints/recommended.yaml`, strict analyzer modes, and Bitwild's shared rules. | | `flutter.yaml` | `dart.yaml` plus `package:flutter_lints/flutter.yaml` and `prefer_const_constructors`. | | `plugin.yaml` | The [`bitwild_lints`](../bitwild_lints) analyzer plugin at the matching release, with its recommended rules. | +| `mix.yaml` | The `mix_lint` plugin, for projects that use [Mix](https://github.com/btwld/mix). Include it next to `plugin.yaml` or `plugin_all.yaml`. | | `plugin_all.yaml` | The same plugin with every rule, including the ordering and formatting conventions. Use instead of `plugin.yaml`. | The rule selection comes from the rules most active Bitwild repositories already diff --git a/packages/bitwild_analysis/lib/mix.yaml b/packages/bitwild_analysis/lib/mix.yaml new file mode 100644 index 0000000..af78366 --- /dev/null +++ b/packages/bitwild_analysis/lib/mix.yaml @@ -0,0 +1,22 @@ +# Enables the mix_lint analyzer plugin for projects that use Mix. +# +# Include it next to a preset and plugin.yaml: +# +# include: +# - package:bitwild_analysis/flutter.yaml +# - package:bitwild_analysis/plugin.yaml +# - package:bitwild_analysis/mix.yaml +# +# mix_lint's bug checks are warnings, so they are on by default. Its style +# rules are lints: turn them on under the plugin's `diagnostics` in your own +# analysis_options.yaml, as described in mix_lint's README. +# +# mix_lint comes from the Mix repository's main branch until a release that +# loads alongside bitwild_lints is on pub.dev. Git plugin sources need Dart +# 3.13 or later (Flutter 3.47 or later). +plugins: + mix_lint: + git: + url: https://github.com/btwld/mix.git + path: packages/mix_lint + ref: main