chore: document Flutter pre-commit checks
This commit is contained in:
22
CLAUDE.md
22
CLAUDE.md
@@ -6,6 +6,28 @@
|
|||||||
- All new feature development must be done on a `dev` branch, created from `master`
|
- All new feature development must be done on a `dev` branch, created from `master`
|
||||||
- After verification, merge `dev` back into `master`
|
- After verification, merge `dev` back into `master`
|
||||||
|
|
||||||
|
## Pre-Commit Checks
|
||||||
|
|
||||||
|
Before committing Flutter app changes, run these checks:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dart format --set-exit-if-changed .
|
||||||
|
flutter analyze
|
||||||
|
flutter test
|
||||||
|
```
|
||||||
|
|
||||||
|
If `flutter test` fails with a localhost WebSocket/proxy error, follow the proxy cleanup steps in the Flutter Test Rules section below and run it again.
|
||||||
|
|
||||||
|
### Handling Check Failures
|
||||||
|
|
||||||
|
- If a check fails because of the current change, fix the issue before committing.
|
||||||
|
- If `flutter analyze` reports any issue in files changed by the current task, fix it before committing.
|
||||||
|
- If `flutter analyze` reports only unrelated pre-existing issues, do not fix them in the current commit. Report the file, line, and lint/error name, then handle them in a separate cleanup commit or task.
|
||||||
|
- If a check fails because of unrelated pre-existing issues, do not include unrelated fixes in the same commit. Report the failing command and the existing issues, then handle them in a separate cleanup commit or task.
|
||||||
|
- If formatting fails, format only files changed by the current task. Do not run a broad formatting cleanup unless that is the explicit task.
|
||||||
|
- Treat `flutter test` failures as blocking unless the failure is clearly caused by the proxy issue described below and passes after rerunning with proxy variables cleared.
|
||||||
|
- When committing or reporting completion, mention which checks were run and whether any remaining failures are unrelated pre-existing issues.
|
||||||
|
|
||||||
## App Installation Rules
|
## App Installation Rules
|
||||||
|
|
||||||
**Always use `adb install -r` to install the app. Never use `flutter install`.**
|
**Always use `adb install -r` to install the app. Never use `flutter install`.**
|
||||||
|
|||||||
@@ -19,14 +19,6 @@ extension _RegistrationOverviewPart on _RegistrationPageState {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether any scanned item already has a location binding (on_shelf or transferred).
|
|
||||||
bool _hasAnyLocatedInScanned() {
|
|
||||||
return registration_calculations.hasAnyLocatedInScanned(
|
|
||||||
overview: _overview,
|
|
||||||
zongpaiNos: _zongpaiNos,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<String?> _baseUrl() async {
|
Future<String?> _baseUrl() async {
|
||||||
final configService = AppConfigService();
|
final configService = AppConfigService();
|
||||||
final baseUrl = await configService.getString('api_url') ?? '';
|
final baseUrl = await configService.getString('api_url') ?? '';
|
||||||
|
|||||||
Reference in New Issue
Block a user