Skip to content

Commit

Permalink
Released 4.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutton committed May 16, 2023
1 parent 9ef2c21 commit 7de3b83
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 206 deletions.
3 changes: 1 addition & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ linter:
avoid_print : false
# Exclude rules to match pub.dev code.
lines_longer_than_80_chars: false
cascade_invocations: false

cascade_invocations: false
8 changes: 3 additions & 5 deletions lib/src/commands/pub/global/activate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ run: onepub login

final onepubApiUrl = OnePubSettings.use().onepubApiUrlAsString;

final package = readArg('No package to activate given.');
final package = readArg('Please provide a package name to activate');

PackageRef ref;
try {
ref = cache.hosted
.refFor(package, url: argResults['hosted-url'] as String?);
ref = cache.hosted.refFor(package, url: onepubApiUrl);
} on FormatException catch (e) {
usageException('Invalid hosted-url: $e');
usageException('Invalid OnePub Url: $e');
}

// Parse the version constraint, if there is one.
Expand All @@ -74,7 +73,6 @@ run: onepub login
ref.withConstraint(constraint),
null, // all executables
overwriteBinStubs: true,
url: onepubApiUrl,
);

// print('${blue('Successfully activated into $organisationName.')}');
Expand Down
3 changes: 3 additions & 0 deletions lib/src/my_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class MyRunner extends CommandRunner<int> implements PubTopLevel {
CommandSet commandSet;

void init() {
PubTopLevel.addColorFlag(argParser);

results = argParser.parse(args);

Settings().setVerbose(enabled: results['debug'] as bool);
Expand Down Expand Up @@ -110,6 +112,7 @@ class MyRunner extends CommandRunner<int> implements PubTopLevel {
defaultsTo: '.',
valueHelp: 'dir',
);

addCommand(LishCommand());
addCommand(GetCommand());
addCommand(AddCommand());
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pub/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ analyzer:
linter:
rules:
avoid_catching_errors: true
avoid_print: true
avoid_print: false
avoid_private_typedef_functions: true
avoid_redundant_argument_values: true
avoid_returning_null_for_future: true
Expand Down
3 changes: 2 additions & 1 deletion lib/src/pub/command/global_activate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class GlobalActivateCommand extends PubCommand {

PackageRef ref;
try {
ref = cache.hosted.refFor(package, url: argResults['hosted-url'] as String?);
ref = cache.hosted
.refFor(package, url: argResults['hosted-url'] as String?);
} on FormatException catch (e) {
usageException('Invalid hosted-url: $e');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pub/pub_embeddable_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PubEmbeddableCommand extends PubCommand implements PubTopLevel {
String get name => 'pub';

@override
get suggestionAliases => const ['packages', 'pkg'];
List<String> get suggestionAliases => const ['packages', 'pkg'];

@override
String get description => 'Work with packages.';
Expand Down
3 changes: 2 additions & 1 deletion lib/src/pub/solver/package_lister.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ class PackageLister {
var index = lowerBound(
versions,
id,
compare: (PackageId id1, PackageId id2) => id1.version.compareTo(id2.version),
compare: (PackageId id1, PackageId id2) =>
id1.version.compareTo(id2.version),
);
assert(index < versions.length);
assert(versions[index].version == id.version);
Expand Down
3 changes: 2 additions & 1 deletion lib/src/pub/third_party/tar/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:extra_pedantic/analysis_options.2.0.0.yaml
include: package:lints/recommended.yaml

analyzer:
language:
Expand All @@ -15,3 +15,4 @@ linter:
no_default_cases: false
prefer_asserts_with_message: false # We only use asserts for library-internal invariants
prefer_final_parameters: false # Too much noise
constant_identifier_names: false
2 changes: 1 addition & 1 deletion lib/src/pub/third_party/tar/lib/src/reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class TarReader implements StreamIterator<TarEntry> {
/// This methods prevents:
/// * concurrent calls to [moveNext]
/// * a call to [moveNext] while a stream is active:
/// * if [contents] has never been listened to, we drain the stream
/// * if contents has never been listened to, we drain the stream
/// * otherwise, throws a [StateError]
Future<void> _prepareToReadHeaders() async {
if (_isDone) {
Expand Down
56 changes: 0 additions & 56 deletions lib/src/pub/validator/language_version.dart

This file was deleted.

4 changes: 2 additions & 2 deletions lib/src/pub/validator/pubspec_typo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class PubspecTypoValidator extends Validator {
for (final validKey in _validPubspecKeys) {
/// Use a ratio to account allow more more typos in strings with
/// longer lengths.
final ratio =
levenshteinDistance(key as String, validKey) / (validKey.length + key.length);
final ratio = levenshteinDistance(key as String, validKey) /
(validKey.length + key.length);
if (ratio < bestLevenshteinRatio) {
bestLevenshteinRatio = ratio;
closestKey = validKey;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version/version.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// GENERATED BY pub_release do not modify.
/// onepub version
String packageVersion = '4.0.0-beta.2';
String packageVersion = '4.0.0';
Loading

0 comments on commit 7de3b83

Please sign in to comment.