Skip to content

Commit

Permalink
Cleanup meta annotation usage (#3990)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough authored Aug 15, 2023
1 parent d619b37 commit edc76a1
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ linter:
- cancel_subscriptions
- dangling_library_doc_comments
- directives_ordering
- library_annotations
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
Expand Down
7 changes: 2 additions & 5 deletions lib/src/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:io';
import 'dart:isolate';

import 'package:args/args.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;

import 'entrypoint.dart';
Expand Down Expand Up @@ -208,8 +207,7 @@ Future<int> _runDartProgram(
}

/// The result of a `getExecutableForCommand` command resolution.
@sealed
class DartExecutableWithPackageConfig {
final class DartExecutableWithPackageConfig {
/// Can be a .dart file or a incremental snapshot.
final String executable;

Expand Down Expand Up @@ -414,8 +412,7 @@ enum CommandResolutionIssue {
}

/// Indicates that a command string did not resolve to an executable.
@sealed
class CommandResolutionFailedException implements Exception {
final class CommandResolutionFailedException implements Exception {
final String message;
final CommandResolutionIssue issue;
CommandResolutionFailedException._(this.message, this.issue);
Expand Down
5 changes: 1 addition & 4 deletions lib/src/ignore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
/// [1]: https://git-scm.com/docs/gitignore
library;

import 'package:meta/meta.dart';

/// A set of ignore rules representing a single ignore file.
///
/// An [Ignore] instance holds [`.gitignore` rules][1] relative to a given path.
Expand All @@ -48,8 +46,7 @@ import 'package:meta/meta.dart';
/// ```
///
/// [1]: https://git-scm.com/docs/gitignore
@sealed
class Ignore {
final class Ignore {
final List<_IgnoreRule> _rules;

/// Create an [Ignore] instance with a set of [`.gitignore` compatible][1]
Expand Down
4 changes: 1 addition & 3 deletions lib/src/pub_embeddable_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.

import 'package:meta/meta.dart';
import 'package:usage/usage.dart';

import 'command.dart' show PubCommand, PubTopLevel;
Expand All @@ -27,8 +26,7 @@ import 'log.dart';
import 'utils.dart';

/// The information needed for the embedded pub command to send analytics.
@sealed
class PubAnalytics {
final class PubAnalytics {
/// Name of the custom dimension of the dependency kind.
final String dependencyKindCustomDimensionName;

Expand Down
2 changes: 2 additions & 0 deletions lib/src/third_party/tar/lib/src/charcodes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@internal
library;

import 'package:meta/meta.dart';

/// "Line feed" control character.
Expand Down
2 changes: 2 additions & 0 deletions lib/src/third_party/tar/lib/src/utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@internal
library;

import 'dart:async';
import 'dart:convert';
import 'dart:math';
Expand Down
9 changes: 3 additions & 6 deletions lib/src/validator/leak_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const _falseSecretsDocumentationLink = 'https://dart.dev/go/false-secrets';

/// A validator that validates attempts to find secrets that are about to be
/// accidentally leaked.
@sealed
class LeakDetectionValidator extends Validator {
final class LeakDetectionValidator extends Validator {
@override
Future<void> validate() async {
// Load `false_secrets` from `pubspec.yaml`.
Expand Down Expand Up @@ -105,8 +104,7 @@ class LeakDetectionValidator extends Validator {
}

/// Instance of a match against a [LeakPattern].
@sealed
class LeakMatch {
final class LeakMatch {
final LeakPattern pattern;
final SourceSpan span;

Expand All @@ -119,8 +117,7 @@ class LeakMatch {

/// Definition of a pattern for detecting accidentally leaked secrets.
@visibleForTesting
@sealed
class LeakPattern {
final class LeakPattern {
/// Human readable name for the kind of secret this pattern matches.
final String kind;

Expand Down
2 changes: 2 additions & 0 deletions test/get/git/git_not_installed_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.

@TestOn('linux')
library;

import 'dart:io';

import 'package:test/test.dart';
Expand Down
2 changes: 2 additions & 0 deletions test/get/path/relative_symlink_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// support relative paths. So this test, by design, will not pass on Windows.
// So just skip it.
@TestOn('!windows')
library;

import 'package:path/path.dart' as path;
import 'package:test/test.dart';

Expand Down
1 change: 1 addition & 0 deletions test/global/activate/feature_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

@Skip()
library;

import 'package:test/test.dart';

Expand Down
2 changes: 2 additions & 0 deletions test/run/forwards_signal_posix_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// in `pub run`. Now signals only work as expected when sent to the process
// group. And this seems hard to emulate in a test.
@TestOn('!windows')
library;

import 'dart:io';

import 'package:test/test.dart';
Expand Down
1 change: 1 addition & 0 deletions test/validator/file_case_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'windows': Skip('Windows file system is case-insensitive'),
'mac-os': Skip('MacOS file system is case-insensitive'),
})
library;

import 'package:pub/src/exit_codes.dart';
import 'package:test/test.dart';
Expand Down

0 comments on commit edc76a1

Please sign in to comment.