From 981755bd321501c97fcf2e86dcd5ccd9a3143e8c Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Sat, 12 Mar 2022 01:16:07 +0800 Subject: [PATCH] fix: Fix pana static analyze --- .github/workflows/build.yml | 10 ++++------ analysis_options.yaml | 8 ++++---- build.yaml | 9 +++++++++ lib/src/classes.g.dart | 2 ++ lib/src/enum_converter.g.dart | 2 ++ lib/src/rtc_channel.dart | 6 ++++++ lib/src/rtc_engine.dart | 6 ++++++ 7 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 build.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70358f7e5..c4d41d186 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,10 @@ name: CI on: - # pull_request_target: - # types: [opened, synchronize] - # branches: - # - master - # # Temporarily allow check on dev/flutter2-iris branch - # - 'dev/flutter2-iris' + pull_request_target: + types: [opened, synchronize] + branches: + - master push: branches: diff --git a/analysis_options.yaml b/analysis_options.yaml index 398a450c2..6ecbf7bb6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,10 +2,10 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: # Ignore generated files - - 'lib/src/*.g.dart' - - 'lib/src/generated/*.dart' - - 'integration_test_app/**' - - 'test/**' + - "**/*.g.dart" + - lib/src/generated/*.dart + - integration_test_app/** + - test/** linter: rules: diff --git a/build.yaml b/build.yaml new file mode 100644 index 000000000..7a4aa025b --- /dev/null +++ b/build.yaml @@ -0,0 +1,9 @@ +targets: + $default: + builders: + source_gen|combining_builder: + options: + ignore_for_file: + - non_constant_identifier_names + - deprecated_member_use_from_same_package + - unused_element \ No newline at end of file diff --git a/lib/src/classes.g.dart b/lib/src/classes.g.dart index 27900cdd8..9321d5844 100644 --- a/lib/src/classes.g.dart +++ b/lib/src/classes.g.dart @@ -1,5 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: non_constant_identifier_names, deprecated_member_use_from_same_package, unused_element + part of 'classes.dart'; // ************************************************************************** diff --git a/lib/src/enum_converter.g.dart b/lib/src/enum_converter.g.dart index dafb7f5dc..8d7541a19 100644 --- a/lib/src/enum_converter.g.dart +++ b/lib/src/enum_converter.g.dart @@ -1,5 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: non_constant_identifier_names, deprecated_member_use_from_same_package, unused_element + part of 'enum_converter.dart'; // ************************************************************************** diff --git a/lib/src/rtc_channel.dart b/lib/src/rtc_channel.dart index 1e61fd7b5..0ac75bf5b 100644 --- a/lib/src/rtc_channel.dart +++ b/lib/src/rtc_channel.dart @@ -112,6 +112,12 @@ class RtcChannel with RtcChannelInterface { }); } + // TODO(littlegnal): Dead code to pass pana analyze, will fix it in 5.1.0 + // ignore: unused_element + void _cancelSubscription() { + _subscription?.cancel(); + } + /// /// Sets the event handler for the RtcChannel object. /// After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding RtcChannel object. diff --git a/lib/src/rtc_engine.dart b/lib/src/rtc_engine.dart index 5ca0eb55f..fcdde9542 100644 --- a/lib/src/rtc_engine.dart +++ b/lib/src/rtc_engine.dart @@ -220,6 +220,12 @@ class RtcEngine with RtcEngineInterface { }); } + // TODO(littlegnal): Dead code to pass pana analyze, will fix it in 5.1.0 + // ignore: unused_element + void _cancelSubscription() { + _subscription?.cancel(); + } + /// /// Adds event handlers /// The SDK uses the RtcEngineEventHandler class to send callbacks to the app. The app inherits the methods of this class to receive these callbacks. All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling APIs that can block the thread, such as the sendStreamMessage method. Otherwise, the SDK may not work properly.