From eb0cbcca577a23d853f29ee97b680e76151cbead Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 02:39:25 +0000 Subject: [PATCH 1/5] chore(deps): bump very_good_analysis from 7.0.0 to 9.0.0 Bumps [very_good_analysis](https://github.com/VeryGoodOpenSource/very_good_analysis) from 7.0.0 to 9.0.0. - [Release notes](https://github.com/VeryGoodOpenSource/very_good_analysis/releases) - [Changelog](https://github.com/VeryGoodOpenSource/very_good_analysis/blob/main/CHANGELOG.md) - [Commits](https://github.com/VeryGoodOpenSource/very_good_analysis/compare/v7.0.0...v9.0.0) --- updated-dependencies: - dependency-name: very_good_analysis dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e3c523b..6abe72f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,4 +15,4 @@ dependencies: dev_dependencies: test: ^1.16.0 - very_good_analysis: ^7.0.0 + very_good_analysis: ">=7.0.0 <10.0.0" From 77be1c62a219900c71b4fe2d77222abb5f11e67e Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 16 Jun 2025 09:42:36 +0200 Subject: [PATCH 2/5] fix: VGA constraint --- .github/workflows/main.yaml | 27 ++++----------------------- analysis_options.yaml | 2 +- example/analysis_options.yaml | 2 +- example/lib/main.dart | 2 +- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 6 files changed, 9 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 89d533e..34e9e2c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,10 +15,10 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 with: - dart_sdk: '3.5.0' # The minimum Dart SDK version supported by the package. - format_directories: 'lib test' + dart_sdk: "3.5.0" # The minimum Dart SDK version supported by the package. + format_directories: "lib test" check_ignore: true - report_on: 'lib,test' + report_on: "lib,test" no_example: true spell-check: @@ -31,23 +31,4 @@ jobs: modified_files_only: false pana: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4.1.1 - - - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.24.0" #Forcing to 3.24.0 for right now as pana has an issue with Dart 3.6 https://github.com/dart-lang/dartdoc/issues/3947 - - - name: Install Dependencies - run: | - flutter packages get - flutter pub global activate pana - - - name: Verify Pub Score - run: | - PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") - echo "score: $PANA_SCORE" - IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1] - if (( $SCORE < $TOTAL )); then echo "minimum score not met!"; exit 1; fi + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1 diff --git a/analysis_options.yaml b/analysis_options.yaml index c2f4cbb..9df80aa 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1 @@ -include: package:very_good_analysis/analysis_options.7.0.0.yaml +include: package:very_good_analysis/analysis_options.yaml diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index c59316b..ce42cd4 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.7.0.0.yaml +include: package:very_good_analysis/analysis_options.yaml linter: rules: public_member_api_docs: false diff --git a/example/lib/main.dart b/example/lib/main.dart index 4c50bb6..a5597ec 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -61,7 +61,7 @@ class _MyFormState extends State { try { await _submitForm(); _state = _state.copyWith(status: FormzSubmissionStatus.success); - } catch (_) { + } on Exception catch (_) { _state = _state.copyWith(status: FormzSubmissionStatus.failure); } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 7c14d34..efc13ac 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^7.0.0 + very_good_analysis: ^9.0.0 flutter: uses-material-design: true diff --git a/pubspec.yaml b/pubspec.yaml index 6abe72f..a7520c9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,4 +15,4 @@ dependencies: dev_dependencies: test: ^1.16.0 - very_good_analysis: ">=7.0.0 <10.0.0" + very_good_analysis: ^9.0.0 From 7fccf6804e703fbeb5d7e1e5773dc97c80384ec1 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 16 Jun 2025 09:54:10 +0200 Subject: [PATCH 3/5] chore: update Dart SDK to 3.8.0 --- .github/workflows/example.yaml | 2 +- .github/workflows/main.yaml | 2 +- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index f63577c..6d07c2d 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -19,7 +19,7 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: - flutter_channel: stable + flutter_version: 3.32.0 spell-check: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 34e9e2c..c5a1700 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,7 +15,7 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 with: - dart_sdk: "3.5.0" # The minimum Dart SDK version supported by the package. + dart_sdk: 3.8.0 format_directories: "lib test" check_ignore: true report_on: "lib,test" diff --git a/pubspec.yaml b/pubspec.yaml index a7520c9..47f17c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ documentation: https://github.com/VeryGoodOpenSource/formz version: 0.8.0 environment: - sdk: ^3.5.0 + sdk: ^3.8.0 dependencies: meta: ^1.7.0 From b6178b907e844b8d0f928c94968f297214cf877d Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 16 Jun 2025 10:06:25 +0200 Subject: [PATCH 4/5] fix: format --- example/test/main_test.dart | 11 +++++------ lib/formz.dart | 2 +- test/formz_test.dart | 6 ++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/example/test/main_test.dart b/example/test/main_test.dart index c389ba0..7b34c0d 100644 --- a/example/test/main_test.dart +++ b/example/test/main_test.dart @@ -7,11 +7,9 @@ import 'package:mocktail/mocktail.dart'; class MockRandom extends Mock implements Random {} - final _seed = MockRandom(); void main() { - group('$MyApp', () { testWidgets('render example', (tester) async { await tester.pumpWidget(const MyApp()); @@ -20,9 +18,8 @@ void main() { }); group('$MyForm', () { - setUp(() { - when(()=> _seed.nextInt(any())).thenReturn(1); + when(() => _seed.nextInt(any())).thenReturn(1); }); testWidgets('submits valid values', (tester) async { @@ -113,7 +110,8 @@ void main() { await tester.pumpAndSettle(); expect( - find.text('''Password must be at least 8 characters and contain at least one letter and number'''), + find.text( + '''Password must be at least 8 characters and contain at least one letter and number'''), findsOneWidget, ); }); @@ -137,7 +135,8 @@ void main() { await tester.pumpAndSettle(); expect( - find.text('''Password must be at least 8 characters and contain at least one letter and number'''), + find.text( + '''Password must be at least 8 characters and contain at least one letter and number'''), findsOneWidget, ); }); diff --git a/lib/formz.dart b/lib/formz.dart index bb7d9b8..2639574 100644 --- a/lib/formz.dart +++ b/lib/formz.dart @@ -15,7 +15,7 @@ enum FormzSubmissionStatus { failure, /// The form submission has been canceled. - canceled + canceled, } /// Useful extensions on [FormzSubmissionStatus] diff --git a/test/formz_test.dart b/test/formz_test.dart index f75730d..7452b5d 100644 --- a/test/formz_test.dart +++ b/test/formz_test.dart @@ -97,8 +97,7 @@ void main() { expect(NameInput.dirty(value: 'joe').error, isNull); }); - test( - 'error is NameInputError.empty ' + test('error is NameInputError.empty ' 'if super.dirty is used and input is invalid', () { expect(NameInput.dirty().error, NameInputError.empty); }); @@ -135,8 +134,7 @@ void main() { expect(NameInput.dirty().isNotValid, isTrue); }); - test( - 'isNotValid is true if super.dirty is used ' + test('isNotValid is true if super.dirty is used ' 'and input is invalid', () { expect(NameInput.dirty().isValid, isFalse); expect(NameInput.dirty().isNotValid, isTrue); From bd39da61152b776002614fede68b457d8071cf97 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 16 Jun 2025 10:13:40 +0200 Subject: [PATCH 5/5] fix: format --- example/test/main_test.dart | 6 ++++-- test/formz_test.dart | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/example/test/main_test.dart b/example/test/main_test.dart index 7b34c0d..33ebdc5 100644 --- a/example/test/main_test.dart +++ b/example/test/main_test.dart @@ -111,7 +111,8 @@ void main() { expect( find.text( - '''Password must be at least 8 characters and contain at least one letter and number'''), + '''Password must be at least 8 characters and contain at least one letter and number''', + ), findsOneWidget, ); }); @@ -136,7 +137,8 @@ void main() { expect( find.text( - '''Password must be at least 8 characters and contain at least one letter and number'''), + '''Password must be at least 8 characters and contain at least one letter and number''', + ), findsOneWidget, ); }); diff --git a/test/formz_test.dart b/test/formz_test.dart index 7452b5d..442fb8a 100644 --- a/test/formz_test.dart +++ b/test/formz_test.dart @@ -134,11 +134,13 @@ void main() { expect(NameInput.dirty().isNotValid, isTrue); }); - test('isNotValid is true if super.dirty is used ' - 'and input is invalid', () { - expect(NameInput.dirty().isValid, isFalse); - expect(NameInput.dirty().isNotValid, isTrue); - }); + test( + 'isNotValid is true if super.dirty is used and input is invalid', + () { + expect(NameInput.dirty().isValid, isFalse); + expect(NameInput.dirty().isNotValid, isTrue); + }, + ); test('hashCode is correct', () { final name = NameInput.pure();