Skip to content

chore: drop print() from production lib/, harden analyze to --fatal-infos#23

Merged
TaprootFreak merged 1 commit into
developfrom
chore/avoid-print-cleanup
May 18, 2026
Merged

chore: drop print() from production lib/, harden analyze to --fatal-infos#23
TaprootFreak merged 1 commit into
developfrom
chore/avoid-print-cleanup

Conversation

@TaprootFreak

Copy link
Copy Markdown

Summary

flutter analyze had --no-fatal-infos masking 15 avoid_print info-level lints. Cleaned both surfaces and tightened the gate.

lib/usb/bitbox_usb_method_channel.dart — 4 print() calls in production code, leftover debug noise around open() and initBitBox(). Removed; structured logging would belong here if needed, but those calls weren't structured to begin with.

example/lib/main.dart — 11 print() calls drive the demo app's console feedback during the BitBox flow walkthrough. Legitimately demo-only, kept and acknowledged via // ignore_for_file: avoid_print with a comment explaining the policy split.

pull-request.yaml + TESTING.md--no-fatal-infos--fatal-infos. Now every new info-level lint blocks CI.

Local validation

Check Result
flutter analyze --fatal-infos No issues found!
dart format --set-exit-if-changed pass (16 files, 0 changed)
flutter test 12/12 pass
go vet ./... + go test -race -timeout 60s ./... pass

Why no structured logger replacement

The removed prints were string-format dumps, not events any caller actually consumed. If the plugin needs observable behaviour, that should go through dart:developer's log() (configurable per-app) — not through unconditional print that lands in every consumer's console. Filing as a follow-up if the diagnostic ever turns out to have been load-bearing.

…nfos

Production code in lib/usb/bitbox_usb_method_channel.dart had 4 diagnostic
print() calls bracketing the open + initBitBox method-channel invocations.
These were left over from local debugging, never structured logging, and
violate the project policy (no print in lib/, see CONTRIBUTING.md).
Removed.

example/lib/main.dart legitimately uses print() to give runtime console
feedback during the BitBox flow walkthrough. Added an
`ignore_for_file: avoid_print` directive at the top with a comment
explaining the policy split (banned in lib/, allowed in example/lib/).

With both surfaces clean, flipped pull-request.yaml + TESTING.md from
`flutter analyze --no-fatal-infos` to `--fatal-infos`. Every new `info`-
level lint now blocks CI instead of becoming silent debt.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 18, 2026 19:27
@TaprootFreak TaprootFreak merged commit c2b7578 into develop May 18, 2026
3 checks passed
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