Skip to content

Commit

Permalink
chore: add lints and enforce stricter typing and future handling
Browse files Browse the repository at this point in the history
  • Loading branch information
klkucaj committed Jan 2, 2025
1 parent 0a1b4a2 commit 6f53f4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
include: package:lints/recommended.yaml

linter:
rules:
- avoid_dynamic_calls
- unawaited_futures
8 changes: 4 additions & 4 deletions lib/src/headers/headers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ final class _HeadersImpl extends Headers {
return map;
}

/// Date-related headers
/// Date related headers
Map<String, DateTime?> get _dateHeadersMap => {
Headers.dateHeader: date ?? DateTime.now().toUtc(),
Headers.expiresHeader: expires,
Expand All @@ -1413,7 +1413,7 @@ final class _HeadersImpl extends Headers {
accessControlRequestMethod?.value,
};

/// List<String>-related headers
/// String list related headers
Map<String, List<String>?> get _listStringHeadersMap =>
<String, List<String>?>{
Headers.viaHeader: via,
Expand All @@ -1422,7 +1422,7 @@ final class _HeadersImpl extends Headers {
Headers.trailerHeader: trailer,
};

/// Uri-related headers
/// Uri related headers
Map<String, Uri?> get _uriHeadersMap => <String, Uri?>{
Headers.locationHeader: location,
Headers.refererHeader: referer,
Expand All @@ -1431,7 +1431,7 @@ final class _HeadersImpl extends Headers {
Headers.hostHeader: host,
};

/// TypedHeader-related headers
/// TypedHeader related headers
Map<String, TypedHeader?> get _typedHeadersMap => <String, TypedHeader?>{
Headers.fromHeader: from,
Headers.acceptEncodingHeader: acceptEncoding,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
convert: ^3.1.1

dev_dependencies:
dart_flutter_team_lints: ^3.0.0
lints: '>=3.0.0 <5.0.0'
http: '>=1.0.0 <2.0.0'
test: ^1.24.2
test_descriptor: ^2.0.1
2 changes: 1 addition & 1 deletion test/relic_server_serve_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void main() {
Uri.http('localhost:$_serverPort', '/'),
);
request.sink.add([1, 2, 3, 4]);
request.sink.close();
await request.sink.close();

var response = await request.send();
expect(response.statusCode, HttpStatus.ok);
Expand Down

0 comments on commit 6f53f4f

Please sign in to comment.