Skip to content

Commit aca37f6

Browse files
authored
Merge pull request Baseflow#351 from Baseflow/feature/flutter_lint
move to flutter_lint
2 parents d124fe0 + 30529df commit aca37f6

17 files changed

+22
-141
lines changed
Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1 @@
1-
include: package:pedantic/analysis_options.1.8.0.yaml
2-
3-
analyzer:
4-
strong-mode:
5-
implicit-casts: false
6-
# implicit-dynamic: false
7-
errors:
8-
unused_import: warning
9-
unused_local_variable: warning
10-
dead_code: warning
11-
invalid_override_of_non_virtual_member: error
12-
13-
linter:
14-
rules:
15-
- always_declare_return_types
16-
- annotate_overrides
17-
- avoid_empty_else
18-
- avoid_function_literals_in_foreach_calls
19-
- avoid_init_to_null
20-
- avoid_void_async
21-
- await_only_futures
22-
# - avoid_implementing_value_types
23-
- avoid_null_checks_in_equality_operators
24-
- avoid_renaming_method_parameters
25-
- avoid_return_types_on_setters
26-
- avoid_returning_null
27-
- avoid_returning_null_for_void
28-
- avoid_types_as_parameter_names
29-
- avoid_relative_lib_imports
30-
- avoid_unused_constructor_parameters
31-
- camel_case_types
32-
- cancel_subscriptions
33-
#- cascade_invocations
34-
#- comment_references
35-
#- constant_identifier_names
36-
- control_flow_in_finally
37-
- directives_ordering
38-
- empty_catches
39-
- empty_constructor_bodies
40-
- empty_statements
41-
- hash_and_equals
42-
#- implementation_imports
43-
- invariant_booleans
44-
- iterable_contains_unrelated_type
45-
- library_names
46-
- library_prefixes
47-
- list_remove_unrelated_type
48-
- no_adjacent_strings_in_list
49-
- no_duplicate_case_values
50-
- non_constant_identifier_names
51-
- omit_local_variable_types
52-
#- only_throw_errors
53-
- overridden_fields
54-
- package_api_docs
55-
- package_names
56-
- package_prefixed_library_names
57-
- prefer_adjacent_string_concatenation
58-
- prefer_collection_literals
59-
- prefer_conditional_assignment
60-
- prefer_const_constructors
61-
- prefer_contains
62-
- prefer_equal_for_default_values
63-
- prefer_final_fields
64-
- prefer_initializing_formals
65-
#- prefer_int_literals
66-
#- prefer_interpolation_to_compose_strings
67-
- prefer_is_empty
68-
- prefer_is_not_empty
69-
- prefer_single_quotes
70-
- prefer_typing_uninitialized_variables
71-
- recursive_getters
72-
- slash_for_doc_comments
73-
- sort_pub_dependencies
74-
- test_types_in_equals
75-
- throw_in_finally
76-
- type_init_formals
77-
- unawaited_futures
78-
- unnecessary_await_in_return
79-
- unnecessary_brace_in_string_interps
80-
- unnecessary_getters_setters
81-
- unnecessary_lambdas
82-
- unnecessary_null_aware_assignments
83-
- unnecessary_statements
84-
- unnecessary_this
85-
- unrelated_type_equality_checks
86-
- use_rethrow_when_possible
87-
- valid_regexps
88-
# Additional Dart 2.3 lints
89-
- prefer_spread_collections
90-
- prefer_if_elements_to_conditional_expressions
91-
- prefer_for_elements_to_map_fromIterable
1+
include: package:flutter_lints/flutter.yaml
Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
7-
8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
10-
include: package:flutter_lints/flutter.yaml
11-
12-
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
24-
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
28-
# Additional information about this file can be found at
29-
# https://dart.dev/guides/language/analysis-options
1+
include: package:flutter_lints/flutter.yaml

flutter_cache_manager/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>9.0</string>
2525
</dict>
2626
</plist>

flutter_cache_manager/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter_cache_manager/example/linux/flutter/generated_plugin_registrant.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#include "generated_plugin_registrant.h"
68

79
#include <url_launcher_linux/url_launcher_plugin.h>

flutter_cache_manager/example/linux/flutter/generated_plugin_registrant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#ifndef GENERATED_PLUGIN_REGISTRANT_
68
#define GENERATED_PLUGIN_REGISTRANT_
79

flutter_cache_manager/lib/src/cache_manager.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import 'package:flutter_cache_manager/src/result/file_info.dart';
1212
import 'package:flutter_cache_manager/src/result/file_response.dart';
1313
import 'package:flutter_cache_manager/src/storage/cache_object.dart';
1414
import 'package:flutter_cache_manager/src/web/web_helper.dart';
15-
import 'package:pedantic/pedantic.dart';
1615
import 'package:uuid/uuid.dart';
1716

1817
import 'config/config.dart';

flutter_cache_manager/lib/src/cache_store.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:async';
22

33
import 'package:flutter_cache_manager/src/config/config.dart';
44
import 'package:flutter_cache_manager/src/storage/file_system/file_system.dart';
5-
import 'package:pedantic/pedantic.dart';
65

76
import '../flutter_cache_manager.dart';
87
import 'logger.dart';
@@ -86,7 +85,7 @@ class CacheStore {
8685
_memCache[key] = cacheObject;
8786
}
8887
completer.complete(cacheObject);
89-
unawaited(_futureCache.remove(key));
88+
_futureCache.remove(key);
9089
}));
9190
_futureCache[key] = completer.future;
9291
}
@@ -183,7 +182,7 @@ class CacheStore {
183182
_memCache.remove(cacheObject.key);
184183
}
185184
if (_futureCache.containsKey(cacheObject.key)) {
186-
unawaited(_futureCache.remove(cacheObject.key));
185+
_futureCache.remove(cacheObject.key);
187186
}
188187
final file = await fileSystem.createFile(cacheObject.relativePath);
189188
if (await file.exists()) {

flutter_cache_manager/lib/src/compat/file_fetcher.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:http/http.dart' as http;
88
///Released under MIT License.
99
1010
/// Deprecated FileFetcher function
11-
typedef Future<FileFetcherResponse> FileFetcher(String url,
11+
typedef FileFetcher = Future<FileFetcherResponse> Function(String url,
1212
{Map<String, String>? headers});
1313

1414
abstract class FileFetcherResponse {

flutter_cache_manager/lib/src/logger.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class CacheLogger {
1717
/// Function to log a message on a certain loglevel
1818
void log(String message, CacheManagerLogLevel level) {
1919
if (CacheManager.logLevel.index >= level.index) {
20+
// ignore: avoid_print
2021
print(message);
2122
}
2223
}

0 commit comments

Comments
 (0)