Skip to content

Commit e9eceb6

Browse files
authored
refactor: upgrade analysis options (#1798)
1 parent b76b159 commit e9eceb6

38 files changed

+93
-58
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
include: package:very_good_analysis/analysis_options.6.0.0.yaml
1+
include: package:very_good_analysis/analysis_options.yaml
2+
linter:
3+
rules:
4+
# Experimental and there are lots of false positives
5+
specify_nonobvious_property_types: false

packages/dart_frog/lib/dart_frog.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/// A fast, minimalistic backend framework for Dart 🎯
2-
library dart_frog;
3-
41
export 'src/_internal.dart'
52
show
63
Cascade,

packages/dart_frog/lib/src/request_logger.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ part of '_internal.dart';
1111
///
1212
/// If [logger] is not passed, the message is just passed to [print].
1313
Middleware requestLogger({
14+
// ignoring to match the shelf.logRequests signature
1415
// ignore: avoid_positional_boolean_parameters
1516
void Function(String message, bool isError)? logger,
1617
}) {

packages/dart_frog/lib/src/router.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ class RouterEntry {
322322
final params = <String>[];
323323
var pattern = '';
324324
for (final m in _parser.allMatches(route)) {
325+
// avoiding string_buffers to align with shelf_router
325326
// ignore: use_string_buffers
326327
pattern += RegExp.escape(m[1]!);
327328
if (m[2] != null) {
@@ -418,6 +419,7 @@ class RouterEntry {
418419
}
419420

420421
if (_handler is Handler || _params.isEmpty) {
422+
// ignoring to align with shelf_router
421423
// ignore: avoid_dynamic_calls
422424
return await _handler(updatedContext) as Response;
423425
}

packages/dart_frog/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dev_dependencies:
2828
mocktail: ^1.0.0
2929
path: ^1.8.2
3030
test: ^1.19.2
31-
very_good_analysis: ">=5.1.0 <7.0.0"
31+
very_good_analysis: ^9.0.0
3232

3333
false_secrets:
3434
- test/src/serve_test.dart

packages/dart_frog/test/src/body_parsers/form_data_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignoring for testing purposes
12
// ignore_for_file: prefer_const_constructors
23
// ignore_for_file: deprecated_member_use_from_same_package
34

packages/dart_frog/test/src/http_method_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignoring for testing purposes
12
// ignore_for_file: prefer_const_declarations
23

34
import 'package:dart_frog/dart_frog.dart';

packages/dart_frog/test/src/provider_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ void main() {
6464
Response onRequest(RequestContext context) {
6565
try {
6666
context.read<Uri>();
67+
// ignoring since we need to catch the StateError for testing
68+
// ignore: avoid_catches_without_on_clauses
6769
} catch (e) {
6870
exception = e;
6971
}

packages/dart_frog/test/src/request_logger_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore_for_file: avoid_positional_boolean_parameters
2-
31
import 'package:dart_frog/dart_frog.dart';
42
import 'package:mocktail/mocktail.dart';
53
import 'package:test/test.dart';
@@ -10,6 +8,8 @@ void main() {
108
group('requestLogger', () {
119
var gotLog = false;
1210

11+
// ignoring to align with shelf logger
12+
// ignore: avoid_positional_boolean_parameters
1313
void logger(String msg, bool isError) {
1414
expect(gotLog, isFalse);
1515
gotLog = true;

packages/dart_frog/test/src/response_test.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,7 @@ void main() {
110110

111111
group('bufferOutput', () {
112112
test('is omitted by default', () {
113-
final response = Response.stream(
114-
body: const Stream.empty(),
115-
// ignore: avoid_redundant_argument_values
116-
bufferOutput: true,
117-
);
113+
final response = Response.stream(body: const Stream.empty());
118114

119115
expect(
120116
response.context,

0 commit comments

Comments
 (0)