Fix linter for generated files

This commit is contained in:
Mattia 2020-10-30 22:20:31 +01:00
parent 1b8b45e36b
commit c34ae57ee7
5 changed files with 18 additions and 11 deletions

View File

@ -1,6 +1,5 @@
include: package:effective_dart/analysis_options.yaml
linter:
rules:
- valid_regexps
@ -59,6 +58,12 @@ linter:
- use_function_type_syntax_for_parameters
analyzer:
exclude:
exclude: #most likely not all of these are needed, but as it is now it works.
- "**/*.g.dart"
- "**\*.g.dart"
- /**/*.g.dart
- \**\*.g.dart
- "*.g.dart"
- "**.g.dart"
- example\**
- lib\src\reverse_engineering\responses\generated\**

View File

@ -53,8 +53,6 @@ extension StringUtility on String {
}
return buffer.toString();
}
}
/// List decipher utility.

View File

@ -7,7 +7,6 @@ import '../../extensions/helpers_extension.dart';
import '../../retry.dart';
import '../youtube_http_client.dart';
///
class EmbedPage {
static final _playerConfigExp =
@ -19,7 +18,8 @@ class EmbedPage {
///
String get sourceUrl {
var url = _root.querySelector('*[name="player_ias/base"]').attributes['src'];
var url =
_root.querySelector('*[name="player_ias/base"]').attributes['src'];
if (url == null) {
return null;
}

View File

@ -14,7 +14,6 @@ dependencies:
equatable: ^1.1.0
meta: ^1.1.8
dev_dependencies:
effective_dart: ^1.2.4
console: ^3.1.0

View File

@ -18,15 +18,18 @@ void main() {
});
test('Search a youtube videos from the search page', () async {
var searchQuery = await yt.search.queryFromPage('hello');
// ignore: deprecated_member_use_from_same_package
var searchQuery = await yt.search.queryFromPage(
'hello');
expect(searchQuery.content, isNotEmpty);
expect(searchQuery.relatedVideos, isNotEmpty);
expect(searchQuery.relatedQueries, isNotEmpty);
});
test('Search with no results', () async {
var query =
await yt.search.queryFromPage('g;jghEOGHJeguEPOUIhjegoUEHGOGHPSASG');
// ignore: deprecated_member_use_from_same_package
var query = await yt.search.queryFromPage(
'g;jghEOGHJeguEPOUIhjegoUEHGOGHPSASG');
expect(query.content, isEmpty);
expect(query.relatedQueries, isEmpty);
expect(query.relatedVideos, isEmpty);
@ -35,7 +38,9 @@ void main() {
});
test('Search youtube videos have thumbnails', () async {
var searchQuery = await yt.search.queryFromPage('hello');
// ignore: deprecated_member_use_from_same_package
var searchQuery = await yt.search.queryFromPage(
'hello');
expect(searchQuery.content.first, isA<SearchVideo>());
var video = searchQuery.content.first as SearchVideo;