Repository navigation
v1.14.0
- New:
arch_guard affected.arch_guard affected --since origin/mainprints the test files that the branch's changes can affect, one per line, so you can run only those:t=$(arch_guard affected --since origin/main); [ -n "$t" ] && dart test $t. It scanslib/,test/andintegration_test/of the root and each workspace member, and walks imports, exports andpartdirectives backwards from each changed file, including ignored and conditional imports. A deleted, renamed or generated file (*.g.dart,*.mocks.dart) affects the files that import it. Tests in a workspace root withoutlib/are scanned too. A changedpubspec.yamlorpubspec.lockaffects its whole package (the root one affects everything).--print filesand--print packageslist affected files or package names instead (melos exec --scope=...).--jsonprints all lists. Changed non-Dart files are listed in a note on stderr. With nothing affected, stdout is empty and stderr saysNo affected tests.Exits0, or2when git fails, or64without--since. - New:
arch_guard why.arch_guard why lib/domain flutterprints the shortest import path from a file or folder to a file, folder or package, onefile:line import targetline per step. Arguments can be a file, a folder, a file name that matches one file,package:x, a bare package name ordart:io. Apackage:URI into the project's own packages (package:app/data/api.dart) names those files. With no path it printsNo import path from ... to ....and exits1, so CI can assert that a path never appears. An unknown or ambiguous argument exits64. --sincesees renames. A file renamed on the branch now counts as changed under its old path too.--watchnow rejects every subcommand (init,affected,why) with exit64.
Library: ProjectScanner.memberScanDirs, AffectedFiles, AffectedResult, ImportPath, ImportStep, PathTarget, FileTarget, PackageTarget.