Skip to content

Commit

Permalink
Bump to Dart 2.19, to use some new features and get new lint rules (#168
Browse files Browse the repository at this point in the history
)
  • Loading branch information
srawlins authored Apr 20, 2023
1 parent c1ebdc9 commit dd7fef4
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [2.17.0, dev]
sdk: [2.19.0, dev]
steps:
- uses: actions/checkout@v2
- uses: dart-lang/[email protected]
Expand Down
13 changes: 6 additions & 7 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ linter:
- avoid_dynamic_calls
- avoid_positional_boolean_parameters
- avoid_unused_constructor_parameters
- dangling_library_doc_comments
- directives_ordering
- collection_methods_unrelated_type
- implicit_call_tearoffs
- library_annotations
- lines_longer_than_80_chars
- package_api_docs
- prefer_asserts_in_initializer_lists
- prefer_if_elements_to_conditional_expressions
- unawaited_futures
- unnecessary_library_directive
- unnecessary_parenthesis
- unreachable_from_main
- use_super_parameters

# Enable when using Dart >=2.19.0.
#- collection_methods_unrelated_type
#- enable_null_safety
#- implicit_call_tearoffs
#- library_annotations
#- unnecessary_library_directive
2 changes: 0 additions & 2 deletions lib/src/date_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// file for details. All rights reserved. Use of this source code is governed
// by a BSD-style license that can be found in the LICENSE file.

library timezone.src.date_time;

import 'package:timezone/src/env.dart';
import 'package:timezone/src/location.dart';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// file for details. All rights reserved. Use of this source code is governed
// by a BSD-style license that can be found in the LICENSE file.

library timezone.src.env;

import 'package:timezone/src/location.dart';
import 'package:timezone/src/location_database.dart';
import 'package:timezone/src/tzdb.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/src/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// file for details. All rights reserved. Use of this source code is governed
// by a BSD-style license that can be found in the LICENSE file.

library timezone.src.exceptions;

class TimeZoneInitException implements Exception {
final String msg;

Expand Down
2 changes: 0 additions & 2 deletions lib/src/tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// file for details. All rights reserved. Use of this source code is governed
// by a BSD-style license that can be found in the LICENSE file.

library timezone.src.tools;

import 'dart:collection';

import 'package:timezone/timezone.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/src/tzdata/zicfile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// file for details. All rights reserved. Use of this source code is governed
// by a BSD-style license that can be found in the LICENSE file.

library timezone.src.tzdata.zicfile;

import 'dart:collection';
import 'dart:convert' show ascii;
import 'dart:typed_data';
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.9.2
description: Time zone database and time zone aware DateTime.
repository: https://github.com/srawlins/timezone
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.19.0 <3.0.0'
dependencies:
path: ^1.8.0
dev_dependencies:
Expand Down
2 changes: 2 additions & 0 deletions test/datetime_browser_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@TestOn('browser')
library;

import 'package:test/test.dart';
import 'package:timezone/browser.dart';

Expand Down
2 changes: 2 additions & 0 deletions test/datetime_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@TestOn('vm')
library;

import 'package:test/test.dart';
import 'package:timezone/data/latest.dart';
import 'package:timezone/timezone.dart';
Expand Down
2 changes: 2 additions & 0 deletions test/datetime_test_no_database.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@TestOn('vm')
library;

import 'package:test/test.dart';
import 'package:timezone/timezone.dart';

Expand Down
2 changes: 2 additions & 0 deletions test/two_way_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@TestOn('vm')
library;

import 'package:test/test.dart';
import 'package:timezone/standalone.dart';

Expand Down
8 changes: 1 addition & 7 deletions test/zicfile_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@TestOn('vm')
library timezone.test.zicfile_test;
library;

import 'dart:io';
import 'dart:isolate';
Expand All @@ -8,12 +8,6 @@ import 'package:path/path.dart' as p;
import 'package:test/test.dart';
import 'package:timezone/tzdata.dart' as tzdata;

tzdata.TimeZone z(int offset,
{required bool isDst, required int abbreviationIndex}) {
return tzdata.TimeZone(offset,
isDst: isDst, abbreviationIndex: abbreviationIndex);
}

void main() {
test('Read US/Eastern 2014h tzfile', () async {
var packageUri = Uri(scheme: 'package', path: 'timezone/timezone.dart');
Expand Down
1 change: 1 addition & 0 deletions tool/encode_tzf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/// ```sh
/// pub run tool/encode_tzf --zoneinfo path/to/zoneinfo
/// ```
library;

import 'dart:io';
import 'package:args/args.dart';
Expand Down
1 change: 1 addition & 0 deletions tool/get.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/// dart pub run tool/encode_dart lib/data/latest_all.{tzf,dart}
/// dart pub run tool/encode_dart lib/data/latest_10y.{tzf,dart}
/// ```
library;

import 'dart:async';
import 'dart:io';
Expand Down

0 comments on commit dd7fef4

Please sign in to comment.