repo/lockfile-committed/flutter
Dependency lockfile is committed
Implements repo/lockfile-committed for flutter.
| Severity | error |
| Tiers | 1, 2 |
| Stacks | flutter |
| Scope | each |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
pubspec.lock is tracked when pubspec.yaml declares dependencies; a pub workspace member (resolution: workspace) uses the pubspec.lock of the workspace root above it.
Why
Builds are reproducible only when dependency versions are pinned in git.
Check
"pubspec.lock" in tracked() || scan("pubspec.yaml", r'^(dev_)?dependencies:').size() == 0 || (scan("pubspec.yaml", r'^resolution:\s*workspace').size() > 0 && ["../", "../../", "../../../"].exists(d, file(d + "pubspec.lock")))Fix
Run flutter pub get (or dart pub get) and commit pubspec.lock.
Agent instruction: Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.
See: https://fleetlint.org/baseline/#dependencies, https://fleetlint.org/stacks/#flutter--dart
Generated by fleetlint docs from catalog v0.3.1.