Repository navigation
Use leancode_lint 28 with its analyzer plugin - #115
Merged
Merged
Conversation
Follows the setup in ciach: leancode_lint is a dev dependency on its latest version and its rules run as an analyzer plugin, with cognitive_complexity turned on. The Dart 3.13 that leancode_lint needs is only required to develop the package; consumers never resolve dev dependencies. - CI analyzes with `dart analyze --fatal-infos`, since `flutter analyze` leaves out plugin diagnostics, and checks formatting. - A new `floor` job runs the tests on Flutter 3.19.6, the lower bound in pubspec.yaml, with leancode_lint dropped. - The test and publish jobs and .fvmrc move to Flutter 3.47.8. - prefer_dot_shorthand stays off: the package supports Dart 3.3 and the rule does not check the language version. - unsafe_variance is ignored: the controllers are invariant in their value type by design, and satisfying it would change the public API. - Fixed the new findings: catch parameter names, unneeded `async`, and comments without a leading space in the example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXYs8AHH4YLzzVwNqW3rEx
Both now enable leancode_lint's analyzer plugin, like the package. docs_app/flutter: - Flutter 3.47.8 in docs.yml. Its Dart is 3.13, so the separate Dart setup that the landing page needed is gone. - CI analyzes with `dart analyze --fatal-infos`, since `flutter analyze` leaves out plugin diagnostics. - The generator writes package imports in the registry, laid out the way `dart format` writes them, and also ignores `unnecessary_ignore` next to `unused_import` in the prelude, since most snippets use every import. - unsafe_variance is ignored for the Docs* field widgets, as in the package; prefer_dot_shorthand stays off (floor is Dart 3.8). - islandTheme ignores cognitive_complexity: its score is flat light/dark choices, not nesting. landing: - leancode_lint 28 with the analyzer-12 override kept for jaspr_builder; the analysis server builds the plugin in a package of its own. - prefer_dot_shorthand is on (the landing page is on Dart 3.10+), with its 22 findings fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXYs8AHH4YLzzVwNqW3rEx
jaspr, jaspr_builder and jaspr_cli come from the commit of jaspr's `next` branch that ciach's website uses (9311973c), whose builder supports analyzer 13 and newer. That lifts the analyzer-12 caps on build_runner, build_web_compilers and dart_style and the analyzer override, and lets jaspr_lints run next to leancode_lint, with the same diagnostics as in ciach. Its two findings are fixed: the source tabs use `input(...)`, and the icon paths pass their children last. The rendered page is the same apart from the order of the attributes on the source-tab radio inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXYs8AHH4YLzzVwNqW3rEx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXYs8AHH4YLzzVwNqW3rEx
|
Docs preview: https://advanced-forms-fz6scek2d-leancode.vercel.app Built from bed274f; the landing page is at |
PiotrRogulski
marked this pull request as ready for review
October 27, 2026 15:52
PiotrRogulski
requested review from
KamilSztandur and
mateusz-pietras
as code owners
October 27, 2026 15:52
KamilSztandur
approved these changes
Oct 28, 2026
KamilSztandur
enabled auto-merge
October 28, 2026 09:03
KamilSztandur
disabled auto-merge
October 28, 2026 10:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the package, the example app, the docs bundle and the landing page to leancode_lint 28, with its rules running as an analyzer plugin.
Package and example
analysis_options.yamlenables theleancode_lintplugin withcognitive_complexityon. The example has the same setup.prefer_dot_shorthandstays off: the rule does not check the language version, and dot shorthands need Dart 3.10.unsafe_varianceis ignored: the controllers hold callbacks over their value type (validators,getValueSetter(), builders), so they are invariant in it by design, and satisfying the rule would change the public API.lib/(internal only), unneededasyncin tests and the example, comments without a leading space in the example.CI
flutter analyzeleaves out analyzer-plugin diagnostics, so CI now runsdart analyze --fatal-infos. It also checks formatting..fvmrcmove to Flutter 3.47.8 (Dart 3.13).flutter pub publishresolves dev dependencies too, so publishing needs it.pubspec.yaml, with leancode_lint dropped. It usesdart pub get --no-exampleandflutter test --no-pub; thefluttervariants still touchexample/and fail.Docs bundle (
docs_app/flutter)docs.yml. It already includes Dart 3.13, so the separate Dart setup is removed. Analysis switches todart analyze --fatal-infos.docs_app/scripts/flutter-examples.mjs) writes package imports in the registry, indart formatlayout. The prelude ignoresunnecessary_ignorenext tounused_import, since most snippets use all three imports.unsafe_varianceis ignored for theDocs*field widgets, for the same reason as in the package.islandThemeignorescognitive_complexity: its score comes from flat light/dark choices, not nesting.Landing page
9311973cof jaspr'snextbranch, whose builder supports analyzer 13 and newer. That removes the analyzer-12 caps onbuild_runner,build_web_compilersanddart_style, and the analyzer override. The commit is pinned inpubspec.yaml,analysis_options.yaml,docs.ymlandREADME.md. Go back to version constraints once jaspr publishes a release with it.jaspr_lintsruns next to leancode_lint.prefer_dot_shorthandis on, since the landing page is on Dart 3.10+. All findings are fixed.index.htmlonly differs from before in the attribute order on the source-tab radio inputs.landing.jsis identical.Verified locally
dart analyze --fatal-infosand formatting clean; package and example tests pass on 3.47.8. The package tests (285) also pass on 3.19.6 with leancode_lint dropped.npm run build.Generated by Claude Code