From c7670b9ccf18abd078c6838c3ce0aed606e79c90 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Sun, 26 Jul 2020 10:52:29 +0900 Subject: [PATCH] CI: added static analysis, restored test step --- .github/workflows/main.yml | 8 +++++--- analysis_options.yaml | 14 +++++++++----- test/widget_test.dart | 8 ++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 test/widget_test.dart diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46752b1c5..bbf443a5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,11 @@ jobs: working-directory: ${{ github.workspace }}/scripts run: ./update_flutter_version.sh - # `flutter test` fails if test directory is missing - #- name: Run the unit tests. - # run: flutter test + - name: Static analysis. + run: flutter analyze + + - name: Unit tests. + run: flutter test - name: Build signed artifacts. # `KEY_JKS` should contain the result of: diff --git a/analysis_options.yaml b/analysis_options.yaml index 780713728..88c48c0b9 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -10,20 +10,24 @@ analyzer: linter: rules: + # from 'effective dart', excluded avoid_function_literals_in_foreach_calls: false # benefit? lines_longer_than_80_chars: false # nope + avoid_classes_with_only_static_members: false # too strict - avoid_classes_with_only_static_members: false # maybe? + # from 'effective dart', undecided prefer_relative_imports: false # check IDE support (auto import, file move) public_member_api_docs: false # maybe? - always_declare_return_types: true + # from 'effective dart', included avoid_types_on_closure_parameters: true constant_identifier_names: true - prefer_const_constructors: true - prefer_const_constructors_in_immutables: true - prefer_const_declarations: true prefer_function_declarations_over_variables: true prefer_interpolation_to_compose_strings: true unnecessary_brace_in_string_interps: true unnecessary_lambdas: true + + # misc + prefer_const_constructors: false # too noisy + prefer_const_constructors_in_immutables: true + prefer_const_declarations: true diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 000000000..abe19491a --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,8 @@ +import 'package:aves/main.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('TODO TLAD', (tester) async { + await tester.pumpWidget(AvesApp()); + }); +}