Skip to content

feat(flutter): add Flutter command filters#669

Open
copperspeed wants to merge 1 commit intortk-ai:developfrom
copperspeed:feat/flutter/add-flutter-command-filters
Open

feat(flutter): add Flutter command filters#669
copperspeed wants to merge 1 commit intortk-ai:developfrom
copperspeed:feat/flutter/add-flutter-command-filters

Conversation

@copperspeed
Copy link

@copperspeed copperspeed commented Mar 17, 2026

Summary

  • Adds rtk flutter test -- suppresses passing progress lines, short-circuits to [PASS] All tests passed on clean runs, shows failure blocks with assertion details (~90% token reduction)
  • Adds rtk flutter analyze -- keeps only warning - and error - lines, suppresses info - lines and headers (~80% token reduction)
  • Adds rtk flutter build -- keeps only the final result line or error diagnostics (~85% token reduction)
  • Adds rtk flutter pub -- strips download noise, keeps Got dependencies! summary and compatibility warnings (~70% token reduction)

Before / After

flutter test (passing, 6 lines -> 1 line):

# Before
00:00 +0: loading D:/dev/project/test/file_test.dart
00:01 +1: TsIconSize - constants compact is 20
00:01 +1: TsIconSize - constants standard is 24
00:02 +20: All tests passed!

# After
[PASS] All tests passed

flutter analyze (5 lines -> 2 lines):

# Before
Analyzing tradesmen...
warning - Dead code - lib/features/auth/...:60:50 - dead_code
warning - The left operand can't be null - lib/features/auth/...:60:53 - dead_null_aware_expression
   info - Unnecessary use of multiple underscores - test/...:113:11 - unnecessary_underscores

# After
warning - Dead code - lib/features/auth/...:60:50 - dead_code
warning - The left operand can't be null - lib/features/auth/...:60:53 - dead_null_aware_expression

flutter pub get (8 lines -> 2 lines):

# Before
Resolving dependencies...
Downloading packages...
  _fe_analyzer_shared 85.0.0 (98.0.0 available)
  flutter_riverpod 2.6.1 (3.3.1 available)
  ...
Got dependencies!
36 packages have newer versions incompatible with dependency constraints.

# After
Got dependencies!
36 packages have newer versions incompatible with dependency constraints.

Implementation notes

  • Filter functions follow the same pattern as pytest_cmd.rs (plain text parsing, no JSON)
  • Flutter test uses the compact reporter format (HH:MM +N: / HH:MM +N -M: prefix detection)
  • Flutter analyze uses - separator; summary line comes from stderr
  • Fixtures captured from real Flutter 3.x project output (compact test reporter)
  • Command registered in src/main.rs with FlutterCommands subcommand enum
  • Rewrite rule added to src/discover/rules.rs

Test plan

  • rtk flutter test on passing suite -> single [PASS] All tests passed line
  • rtk flutter test with failing test -> failure block only, no progress lines
  • rtk flutter analyze with warnings and info -> warnings shown, info suppressed
  • rtk flutter analyze clean -> [PASS] No issues found
  • rtk flutter build apk -> final built line only
  • rtk flutter pub get -> summary + compat warning only
  • rtk rewrite "flutter test" -> prints rtk flutter test
  • cargo test flutter -> 22 unit tests pass

Generated with Claude Code

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.

1 participant