Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion dart/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
include: package:pedantic/analysis_options.yaml
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
3 changes: 2 additions & 1 deletion dart/lib/src/diagnostic_logger.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:sentry/sentry.dart';
import 'protocol.dart';
import 'sentry_options.dart';

class DiagnosticLogger {
final Logger _logger;
Expand Down
3 changes: 1 addition & 2 deletions dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
10 changes: 3 additions & 7 deletions dart/lib/src/hub_adapter.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions dart/lib/src/noop_hub.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion dart/lib/src/sentry_io_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion dart/lib/src/transport/noop_transport.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:sentry/sentry.dart';
import '../protocol.dart';
import 'transport.dart';

class NoOpTransport implements Transport {
@override
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/transport/transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down