Skip to content

feat: add a guard test that keeps the package out of the app - #37

Merged
saimskywalker merged 1 commit into
mainfrom
fix-27-static-guard
Nov 1, 2026
Merged

saimskywalker merged 1 commit into
mainfrom
fix-27-static-guard

Conversation

@saimskywalker

Copy link
Copy Markdown
Owner

Apps can now add expectRebuildBudgetIsTestOnly from guard.dart to their tests, or run dart run imaji_rebuild_budget:check in CI, to fail if the package ends up in dependencies or is imported from lib/. The example app uses it.

Fixes #27

expectRebuildBudgetIsTestOnly, from package:imaji_rebuild_budget/guard.dart,
fails when the app lists the package under dependencies or imports it from
lib/, naming the file and line of each finding. dart run
imaji_rebuild_budget:check runs the same check outside flutter test. The
pubspec is read by a small reader of top-level keys because package:yaml is
not in flutter_test's dependencies. The example app runs the guard.

Fixes #27
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 855ce948-468a-4a6a-a3f1-a74296549f88
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@saimskywalker
saimskywalker merged commit 2e5e715 into main Nov 1, 2026
6 checks passed
@saimskywalker
saimskywalker deleted the fix-27-static-guard branch November 1, 2026 11:34
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.

Refuse to run outside flutter test, and a guard test that fails if the package is a runtime dependency or imported from lib/

1 participant