chore: drop print() from production lib/, harden analyze to --fatal-infos#23
Merged
Merged
Conversation
…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.
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.
Summary
flutter analyzehad--no-fatal-infosmasking 15avoid_printinfo-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()andinitBitBox(). 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_printwith a comment explaining the policy split.pull-request.yaml + TESTING.md —
--no-fatal-infos→--fatal-infos. Now every newinfo-level lint blocks CI.Local validation
flutter analyze --fatal-infosNo issues found!dart format --set-exit-if-changedflutter testgo vet ./...+go test -race -timeout 60s ./...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'slog()(configurable per-app) — not through unconditionalprintthat lands in every consumer's console. Filing as a follow-up if the diagnostic ever turns out to have been load-bearing.