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.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
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.
A finding of this rule points at pubspec.lock.
Sources
- https://github.com/ossf/package-manager-best-practices/blob/main/published/npm.md (guidance)
- https://fleetlint.org/baseline/#dependencies (convention)
- https://dart.dev/tools/pub/packages (spec)
- https://fleetlint.org/stacks/#flutter–dart
Generated by fleetlint docs from catalog v0.5.0.