diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a0ec80ec..6d9342b213 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Fix: Breadcrumb data should accept serializable types and not only String values - Ref: added Scope.applyToEvent - Ref: rename sdk files accordely to their content +- chore: new analysis options rules - Ref: rename the `throwable` argument name to `exception` in `captureEvents(...)` # `package:sentry` changelog diff --git a/dart/analysis_options.yaml b/dart/analysis_options.yaml index d4fcc1ad82..b765dd0459 100644 --- a/dart/analysis_options.yaml +++ b/dart/analysis_options.yaml @@ -1 +1,17 @@ -include: package:pedantic/analysis_options.yaml \ No newline at end of file +include: package:pedantic/analysis_options.yaml + +analyzer: + errors: + # treat missing required parameters as a warning (not a hint) + missing_required_param: error + # treat missing returns as a warning (not a hint) + missing_return: error + # allow having TODOs in the code + todo: ignore + # allow self-reference to deprecated members (we do this because otherwise we have + # to annotate every member in every test, assert, etc, when we deprecate something) + deprecated_member_use_from_same_package: warning + +linter: + rules: + - prefer_relative_imports \ No newline at end of file diff --git a/dart/lib/src/diagnostic_logger.dart b/dart/lib/src/diagnostic_logger.dart index bc2737923f..77148b18be 100644 --- a/dart/lib/src/diagnostic_logger.dart +++ b/dart/lib/src/diagnostic_logger.dart @@ -1,4 +1,5 @@ -import 'package:sentry/sentry.dart'; +import 'protocol.dart'; +import 'sentry_options.dart'; class DiagnosticLogger { final Logger _logger; diff --git a/dart/lib/src/hub.dart b/dart/lib/src/hub.dart index d24d8b56c9..63eaf3faaa 100644 --- a/dart/lib/src/hub.dart +++ b/dart/lib/src/hub.dart @@ -1,8 +1,7 @@ import 'dart:async'; import 'dart:collection'; -import 'package:sentry/src/hub_adapter.dart'; - +import 'hub_adapter.dart'; import 'noop_client.dart'; import 'protocol.dart'; import 'scope.dart'; diff --git a/dart/lib/src/hub_adapter.dart b/dart/lib/src/hub_adapter.dart index be527b7cf3..36d0e85af6 100644 --- a/dart/lib/src/hub_adapter.dart +++ b/dart/lib/src/hub_adapter.dart @@ -1,13 +1,9 @@ import 'dart:async'; -import 'package:sentry/src/protocol/breadcrumb.dart'; -import 'package:sentry/src/protocol/sentry_event.dart'; -import 'package:sentry/src/protocol/sentry_id.dart'; -import 'package:sentry/src/protocol/sentry_level.dart'; -import 'package:sentry/src/sentry.dart'; -import 'package:sentry/src/sentry_client.dart'; - import 'hub.dart'; +import 'protocol.dart'; +import 'sentry.dart'; +import 'sentry_client.dart'; /// Hub adapter to make Integrations testable class HubAdapter implements Hub { diff --git a/dart/lib/src/noop_hub.dart b/dart/lib/src/noop_hub.dart index db7e1637d5..caebabe214 100644 --- a/dart/lib/src/noop_hub.dart +++ b/dart/lib/src/noop_hub.dart @@ -1,11 +1,10 @@ import 'dart:async'; -import 'package:sentry/src/protocol/breadcrumb.dart'; - import 'hub.dart'; import 'protocol/sentry_event.dart'; import 'protocol/sentry_id.dart'; import 'protocol/sentry_level.dart'; +import 'protocol.dart'; import 'sentry_client.dart'; class NoOpHub implements Hub { diff --git a/dart/lib/src/sentry_client.dart b/dart/lib/src/sentry_client.dart index 2d19ed7f2e..a889367f8f 100644 --- a/dart/lib/src/sentry_client.dart +++ b/dart/lib/src/sentry_client.dart @@ -1,13 +1,15 @@ import 'dart:async'; import 'dart:math'; -import 'package:sentry/sentry.dart'; -import 'package:sentry/src/transport/noop_transport.dart'; - import 'protocol.dart'; +import 'scope.dart'; import 'sentry_client_stub.dart' if (dart.library.html) 'sentry_browser_client.dart' if (dart.library.io) 'sentry_io_client.dart'; +import 'sentry_options.dart'; +import 'transport/noop_transport.dart'; +import 'transport/transport.dart'; +import 'version.dart'; /// Logs crash reports and events to the Sentry.io service. abstract class SentryClient { diff --git a/dart/lib/src/sentry_io_client.dart b/dart/lib/src/sentry_io_client.dart index c195aa6f04..ae7975af81 100644 --- a/dart/lib/src/sentry_io_client.dart +++ b/dart/lib/src/sentry_io_client.dart @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:sentry/sentry.dart'; +import 'protocol.dart'; /// A pure Dart client for Sentry.io crash reporting. import 'sentry_client.dart'; import 'sentry_options.dart'; +import 'version.dart'; SentryClient createSentryClient(SentryOptions options) => SentryIOClient(options); diff --git a/dart/lib/src/sentry_options.dart b/dart/lib/src/sentry_options.dart index fbef8248c6..384bfffa32 100644 --- a/dart/lib/src/sentry_options.dart +++ b/dart/lib/src/sentry_options.dart @@ -1,11 +1,12 @@ import 'package:http/http.dart'; -import 'package:sentry/sentry.dart'; -import 'package:sentry/src/transport/noop_transport.dart'; import 'diagnostic_logger.dart'; import 'hub.dart'; import 'protocol.dart'; +import 'transport/noop_transport.dart'; +import 'transport/transport.dart'; import 'utils.dart'; +import 'version.dart'; const defaultEnvironment = 'production'; diff --git a/dart/lib/src/transport/noop_transport.dart b/dart/lib/src/transport/noop_transport.dart index 1488b89258..5c14599bf5 100644 --- a/dart/lib/src/transport/noop_transport.dart +++ b/dart/lib/src/transport/noop_transport.dart @@ -1,6 +1,7 @@ import 'dart:async'; -import 'package:sentry/sentry.dart'; +import '../protocol.dart'; +import 'transport.dart'; class NoOpTransport implements Transport { @override diff --git a/dart/lib/src/transport/transport.dart b/dart/lib/src/transport/transport.dart index c0bf81641a..da7c637b8c 100644 --- a/dart/lib/src/transport/transport.dart +++ b/dart/lib/src/transport/transport.dart @@ -2,10 +2,10 @@ import 'dart:async'; import 'dart:convert'; import 'package:meta/meta.dart'; -import 'package:sentry/src/utils.dart'; import '../protocol.dart'; import '../sentry_options.dart'; +import '../utils.dart'; import 'noop_encode.dart' if (dart.library.io) 'encode.dart'; /// A transport is in charge of sending the event to the Sentry server.