Fix linter for generated files
This commit is contained in:
parent
1b8b45e36b
commit
c34ae57ee7
|
@ -1,6 +1,5 @@
|
||||||
include: package:effective_dart/analysis_options.yaml
|
include: package:effective_dart/analysis_options.yaml
|
||||||
|
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
- valid_regexps
|
- valid_regexps
|
||||||
|
@ -59,6 +58,12 @@ linter:
|
||||||
- use_function_type_syntax_for_parameters
|
- use_function_type_syntax_for_parameters
|
||||||
|
|
||||||
analyzer:
|
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\**
|
- example\**
|
||||||
- lib\src\reverse_engineering\responses\generated\**
|
- lib\src\reverse_engineering\responses\generated\**
|
|
@ -53,8 +53,6 @@ extension StringUtility on String {
|
||||||
}
|
}
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List decipher utility.
|
/// List decipher utility.
|
||||||
|
|
|
@ -7,7 +7,6 @@ import '../../extensions/helpers_extension.dart';
|
||||||
import '../../retry.dart';
|
import '../../retry.dart';
|
||||||
import '../youtube_http_client.dart';
|
import '../youtube_http_client.dart';
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
class EmbedPage {
|
class EmbedPage {
|
||||||
static final _playerConfigExp =
|
static final _playerConfigExp =
|
||||||
|
@ -19,7 +18,8 @@ class EmbedPage {
|
||||||
|
|
||||||
///
|
///
|
||||||
String get sourceUrl {
|
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) {
|
if (url == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ dependencies:
|
||||||
equatable: ^1.1.0
|
equatable: ^1.1.0
|
||||||
meta: ^1.1.8
|
meta: ^1.1.8
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
effective_dart: ^1.2.4
|
effective_dart: ^1.2.4
|
||||||
console: ^3.1.0
|
console: ^3.1.0
|
||||||
|
|
|
@ -18,15 +18,18 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Search a youtube videos from the search page', () async {
|
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.content, isNotEmpty);
|
||||||
expect(searchQuery.relatedVideos, isNotEmpty);
|
expect(searchQuery.relatedVideos, isNotEmpty);
|
||||||
expect(searchQuery.relatedQueries, isNotEmpty);
|
expect(searchQuery.relatedQueries, isNotEmpty);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Search with no results', () async {
|
test('Search with no results', () async {
|
||||||
var query =
|
// ignore: deprecated_member_use_from_same_package
|
||||||
await yt.search.queryFromPage('g;jghEOGHJeguEPOUIhjegoUEHGOGHPSASG');
|
var query = await yt.search.queryFromPage(
|
||||||
|
'g;jghEOGHJeguEPOUIhjegoUEHGOGHPSASG');
|
||||||
expect(query.content, isEmpty);
|
expect(query.content, isEmpty);
|
||||||
expect(query.relatedQueries, isEmpty);
|
expect(query.relatedQueries, isEmpty);
|
||||||
expect(query.relatedVideos, isEmpty);
|
expect(query.relatedVideos, isEmpty);
|
||||||
|
@ -35,7 +38,9 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Search youtube videos have thumbnails', () async {
|
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>());
|
expect(searchQuery.content.first, isA<SearchVideo>());
|
||||||
|
|
||||||
var video = searchQuery.content.first as SearchVideo;
|
var video = searchQuery.content.first as SearchVideo;
|
||||||
|
|
Loading…
Reference in New Issue