Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling errors #3999

Merged
merged 2 commits into from
Aug 28, 2023
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
8 changes: 4 additions & 4 deletions doc/cache_layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ cache conventions.
## Location

The global default pub-cache is located at:
* `$HOME/.pub_cache` on Linux and Mac OS,
* `$HOME/.pub_cache` on Linux and macOS,
* `%LOCALAPPDATA%/Pub/Cache` on Windows.

Prior to Flutter 3.8.0, the Flutter SDK declared `PUB_CACHE=$FLUTTER_ROOT/.pub_cache` overriding the default global pub-cache.

The default location of the pub-cache can be overridden using the environment variable `PUB_CACHE`.

For the remainder of this document we refer to the location of the pub-cache as `$PUB_CACHE`.```
For the remainder of this document we refer to the location of the pub-cache as `$PUB_CACHE`.

## Layout

Expand All @@ -48,7 +48,7 @@ stored in a platform specific config dir:

* On Linux `$XDG_CONFIG_HOME/dart/pub-credentials.json` if `$XDG_CONFIG_HOME` is
defined, otherwise `$HOME/.config/dart/pub-credentials.json`
* On Mac OS: `$HOME/Library/Application Support/dart/pub-credentials.json`
* On macOS: `$HOME/Library/Application Support/dart/pub-credentials.json`
* On Windows: `%APPDATA%/dart/pub-credentials.json`

### Hosted
Expand Down Expand Up @@ -214,7 +214,7 @@ limitations, and we should probably rethink this). A re-activation of the
package will delete all the existing snapshots.

The `incremental` is used while compiling them. (TODO: We should probably remove
this after succesful compilation https://github.com/dart-lang/pub/issues/3896).
this after successful compilation https://github.com/dart-lang/pub/issues/3896).

For packages activated with `--source=path` the lockfile is special-cased to just point
to the activated path, and `.dart_tool/package_config.json`, snapshots are
Expand Down
3 changes: 2 additions & 1 deletion lib/src/command/deps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class DepsCommand extends PubCommand {

@override
Future<void> runProtected() async {
// Explicitly Run this in the directorycase we don't access `entrypoint.packageGraph`.
// Explicitly run this in the directory in case
// we don't access `entrypoint.packageGraph`.
await entrypoint.ensureUpToDate();
final buffer = StringBuffer();

Expand Down
4 changes: 2 additions & 2 deletions lib/src/command/outdated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class OutdatedCommand extends PubCommand {

argParser.addFlag(
'show-all',
help: 'Include dependencies that are already fullfilling --mode.',
help: 'Include dependencies that are already fulfilling --mode.',
);

// Preserve for backwards compatibility.
Expand Down Expand Up @@ -876,7 +876,7 @@ class _MarkedVersionDetails {
final String? _prefix;
final String? _suffix;

/// This should be true if the mode creating this consideres the version as
/// This should be true if the mode creating this considers the version as
/// "good".
///
/// By default only packages with a current version that is not as desired
Expand Down
4 changes: 2 additions & 2 deletions lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import 'utils.dart';

/// The name of the program that is invoking pub
/// 'flutter' if we are running inside `flutter pub` 'dart' otherwise.
String topLevelProgram = _isrunningInsideFlutter ? 'flutter' : 'dart';
String topLevelProgram = _isRunningInsideFlutter ? 'flutter' : 'dart';

bool _isrunningInsideFlutter =
bool _isRunningInsideFlutter =
(Platform.environment['PUB_ENVIRONMENT'] ?? '').contains('flutter_cli');

class PubCommandRunner extends CommandRunner<int> implements PubTopLevel {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ Future<int> runExecutable(
}

/// Runs the dart program (can be a snapshot) at [path] with [args] and hooks
/// its stdout, stderr, and sdtin to this process's.
/// its stdout, stderr, and stdin to this process's.
///
/// [packageConfig] is the path to the ".dart_tool/package_config.json" file.
///
/// If [enableAsserts] is set, runs the program with assertions enabled.
///
/// Passes [vmArgs] to the vm.
///
/// Returns the programs's exit code.
/// Returns the program's exit code.
///
/// Tries to run the program as an isolate if no special [vmArgs] are given
/// otherwise starts new vm in a subprocess. If [alwaysUseSubprocess] is `true`
Expand Down
2 changes: 1 addition & 1 deletion lib/src/global_packages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ fi

// Write this as the system encoding since the system is going to
// execute it and it might contain non-ASCII characters in the
// pathnames.
// path names.
writeTextFile(tmpPath, binstub, encoding: const SystemEncoding());

if (Platform.isLinux || Platform.isMacOS) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ignore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class Ignore {
/// Each value in [patterns] will be interpreted as one or more lines from
/// a `.gitignore` file, in compliance with the [`.gitignore` manual page][1].
///
/// The keys of 'pattern' are the directories to intpret the rules relative
/// The keys of 'pattern' are the directories to interpret the rules relative
/// to. The root should be the empty string, and sub-directories are separated
/// by '/' (but no final '/').
///
Expand Down
6 changes: 3 additions & 3 deletions lib/src/io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ List<String> listDir(
bool includeDirs = true,
Iterable<String> allowed = const <String>[],
}) {
var allowlistFilter = createFileFilter(allowed);
var allowListFilter = createFileFilter(allowed);

// This is used in some performance-sensitive paths and can list many, many
// files. As such, it leans more heavily towards optimization as opposed to
Expand Down Expand Up @@ -376,9 +376,9 @@ List<String> listDir(
// If the basename is in [allowed], don't count its "/." as making the
// file hidden.

if (allowlistFilter.any(pathInDir.contains)) {
if (allowListFilter.any(pathInDir.contains)) {
final allowedBasename =
allowlistFilter.firstWhere(pathInDir.contains);
allowListFilter.firstWhere(pathInDir.contains);
pathInDir =
pathInDir.substring(0, pathInDir.length - allowedBasename.length);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/lock_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ ${yamlToString(data)}

/// Returns `true` if the [text] looks like it uses windows line endings.
///
/// The heuristic used is to count all `\n` in the text and if stricly more than
/// half of them are preceded by `\r` we report `true`.
/// The heuristic used is to count all `\n` in the text and if strictly more
/// than half of them are preceded by `\r` we report `true`.
@visibleForTesting
bool detectWindowsLineEndings(String text) {
var index = -1;
Expand Down
12 changes: 6 additions & 6 deletions lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ class Package {
/// For each directory a .pubignore takes precedence over a .gitignore.
///
/// Note that the returned paths will be always be below [dir], and will
/// always start with [dir] (thus alway be relative to current working
/// directory or absolute id [dir] is absolute.
/// always start with [dir] (thus always be relative to the current working
/// directory) or absolute id [dir] is absolute.
///
/// To convert them to paths relative to the package root, use [p.relative].
List<String> listFiles({String? beneath, bool recursive = true}) {
Expand Down Expand Up @@ -275,16 +275,16 @@ class Package {
'$ignoreFile had invalid pattern $pattern. ${exception.message}',
);
},
// Ignore case on MacOs and Windows, because `git clone` and
// Ignore case on macOS and Windows, because `git clone` and
// `git init` will set `core.ignoreCase = true` in the local
// local `.git/config` file for the repository.
//
// So on Windows and MacOS most users will have case-insensitive
// So on Windows and macOS most users will have case-insensitive
// behavior with `.gitignore`, hence, it seems reasonable to do
// the same when we interpret `.gitignore` and `.pubignore`.
//
// There are cases where a user may have case-sensitive behavior
// with `.gitignore` on Windows and MacOS:
// with `.gitignore` on Windows and macOS:
//
// (A) The user has manually overwritten the repository
// configuration setting `core.ignoreCase = false`.
Expand All @@ -303,7 +303,7 @@ class Package {
// > if appropriate when the repository is created.
//
// In either case, it seems likely that users on Windows and
// MacOS will prefer case-insensitive matching. We specifically
// macOS will prefer case-insensitive matching. We specifically
// know that some tooling will generate `.PDB` files instead of
// `.pdb`, see: [#3003][2]
//
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pubspec_parse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ abstract class PubspecBase {
/// that will be placed on the user's PATH. The value is the name of the
/// .dart script (without extension) in the package's `bin` directory that
/// should be run for that command. Both key and value must be "simple"
/// strings: alphanumerics, underscores and hypens only. If a value is
/// strings: alphanumerics, underscores and hyphens only. If a value is
/// omitted, it is inferred to use the same name as the key.
Map<String, String> get executables {
if (_executables != null) return _executables!;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/solver/result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class SolveResult {
category: 'pub-get',
);
log.fine(
'Sending analytics timing "pub-get" took ${resolutionTime.inMilliseconds} miliseconds',
'Sending analytics timing "pub-get" took ${resolutionTime.inMilliseconds} milliseconds',
);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/solver/solve_suggestions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import '../system_cache.dart';
import 'incompatibility.dart';
import 'incompatibility_cause.dart';

/// Looks through the root-[incompability] of a solve-failure and tries to see if
/// the conflict could resolved by any of the following suggestions:
/// Looks through the root-[incompatibility] of a solve-failure and tries to see
/// if the conflict could resolved by any of the following suggestions:
/// * An update of the current SDK.
/// * Any single change to a package constraint.
/// * Removing the bounds on all constraints, changing less than 5 dependencies.
Expand Down Expand Up @@ -144,7 +144,7 @@ class _ResolutionContext {
final constraint = cause.constraint;
if (constraint == null) return null;

/// Find the most relevant Flutter release fullfilling the constraint.
// Find the most relevant Flutter release fulfilling the constraint.
final bestRelease =
await inferBestFlutterRelease({cause.sdk.identifier: constraint});
if (bestRelease == null) return null;
Expand Down
5 changes: 3 additions & 2 deletions lib/src/source/hosted.dart
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,9 @@ class HostedSource extends CachedSource {
url = _directoryToUrl(directory);
} on FormatException {
log.error('Unable to detect hosted url from directory: $directory');
// If _directoryToUrl can't intepret a directory name, we just silently
// ignore it and hope it's because it comes from a newer version of pub.
// If _directoryToUrl can't interpret a directory name,
// we just silently ignore it and hope it's because it
// comes from a newer version of pub.
//
// This is most likely because someone manually modified PUB_CACHE.
return <RepairResult>[];
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ bool get canUseAnsiCodes {
String getAnsi(String ansiCode) => canUseAnsiCodes ? ansiCode : '';

/// Gets a emoji special character as unicode, or the [alternative] if unicode
/// charactors are not supported by stdout.
/// characters are not supported by stdout.
String emoji(String unicode, String alternative) =>
canUseUnicode ? unicode : alternative;

Expand Down
2 changes: 1 addition & 1 deletion test/cache/add/package_not_found_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:test/test.dart';
import '../../test_pub.dart';

void main() {
test('fails if the package cound not be found on the source', () async {
test('fails if the package could not be found on the source', () async {
await servePackages();

await runPub(
Expand Down
2 changes: 1 addition & 1 deletion test/cache/preload_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void main() {
});

test(
'installs package according to PUB_HOSTED_URL even on non-offical server',
'installs package according to PUB_HOSTED_URL even on non-official server',
() async {
final server = await servePackages();
server.serve('foo', '1.0.0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void main() {

// Currently retraction does not affect prioritization. I.e., if
// pubspec.lock already contains a retracted version, which is the newest
// satisfying the dependency contstraint we will not choose to downgrade.
// satisfying the dependency constraint we will not choose to downgrade.
// In this case we expect a newer version to be published at some point which
// will then cause pub upgrade to choose that one.
test('Allow retracted version when it was already in pubspec.lock', () async {
Expand Down
6 changes: 3 additions & 3 deletions test/pubspec_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ dependencies:
});

test(
'default upper constraint for the SDK applies only if compatibile '
'default upper constraint for the SDK applies only if compatible '
'with the lower bound', () {
var pubspec = Pubspec.parse(
'''
Expand Down Expand Up @@ -686,11 +686,11 @@ environment:

test("throws if the sdk isn't a valid version constraint", () {
expectPubspecException(
'environment: {sdk: "oopies"}',
'environment: {sdk: "oopsies"}',
(pubspec) => pubspec.sdkConstraints,
);
expectPubspecException(
'environment: {sdk: 1.2.3, flutter: "oopies"}',
'environment: {sdk: 1.2.3, flutter: "oopsies"}',
(pubspec) => pubspec.sdkConstraints,
);
});
Expand Down
2 changes: 1 addition & 1 deletion test/test_pub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ Stream<List<int>> tarFromDescriptors(Iterable<d.Descriptor> contents) {
}

/// Replaces the entry at index 9 in [stream] with a 0. This replaces the os
/// entry of a gzip stream, giving us the same stream and thius stable testing
/// entry of a gzip stream, giving us the same stream and this stable testing
/// on all platforms.
///
/// See https://www.rfc-editor.org/rfc/rfc1952 section 2.3 for information
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/goldens/help_test/pub outdated --help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Usage: pub outdated [options]
(defaults to on)
--json Output the results using a json format.
--[no-]prereleases Include prereleases in latest version.
--[no-]show-all Include dependencies that are already fullfilling --mode.
--[no-]show-all Include dependencies that are already fulfilling --mode.
--[no-]transitive Show transitive dependencies.
-C, --directory=<dir> Run this in the directory <dir>.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ pub outdated random_argument
[STDERR] --json Output the results using a json format.
[STDERR] --[no-]prereleases Include prereleases in latest version.
[STDERR] --[no-]show-all Include dependencies that are already
[STDERR] fullfilling --mode.
[STDERR] fulfilling --mode.
[STDERR] --[no-]transitive Show transitive dependencies.
[STDERR] -C, --directory=<dir> Run this in the directory <dir>.
[STDERR]
Expand All @@ -36,7 +36,7 @@ $ pub outdated --bad_flag
[STDERR] --json Output the results using a json format.
[STDERR] --[no-]prereleases Include prereleases in latest version.
[STDERR] --[no-]show-all Include dependencies that are already
[STDERR] fullfilling --mode.
[STDERR] fulfilling --mode.
[STDERR] --[no-]transitive Show transitive dependencies.
[STDERR] -C, --directory=<dir> Run this in the directory <dir>.
[STDERR]
Expand Down
2 changes: 1 addition & 1 deletion test/validator/file_case_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// These tests only work on case-sensitive file systems (ie. only on linux).
@OnPlatform({
'windows': Skip('Windows file system is case-insensitive'),
'mac-os': Skip('MacOS file system is case-insensitive'),
'mac-os': Skip('macOS file system is case-insensitive'),
})
library;

Expand Down
2 changes: 1 addition & 1 deletion test/validator/flutter_constraint_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Future<void> setup({
d.pubspec({
'name': 'test_pkg',
'description':
'A just long enough decription to fit the requirement of 60 characters',
'A just long enough description to fit the requirement of 60 characters',
'homepage': 'https://example.com/',
'version': '1.0.0',
'environment': {
Expand Down
2 changes: 1 addition & 1 deletion test/version_solver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ void override() {
await expectResolves(result: {'a': '2.0.0', 'b': '1.0.0', 'c': '1.0.0'});
});

test('backtracks on overidden package for its constraints', () async {
test('backtracks on overridden package for its constraints', () async {
await servePackages()
..serve('a', '1.0.0', deps: {'shared': 'any'})
..serve('a', '2.0.0', deps: {'shared': '1.0.0'})
Expand Down
6 changes: 3 additions & 3 deletions tool/test-bin/pub_command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import 'package:usage/usage.dart';

final Analytics loggingAnalytics = _LoggingAnalytics();

// A command for explicitly throwing an exception, to test the handling of
// unexpected eceptions.
/// A command for explicitly throwing an exception, to test the handling of
/// unexpected exceptions.
class ThrowingCommand extends PubCommand {
@override
String get name => 'fail';
Expand All @@ -36,7 +36,7 @@ class ThrowingCommand extends PubCommand {
}
}

// A command for testing the ensurePubspecResolved functionality
/// A command for testing the [ensurePubspecResolved] functionality.
class EnsurePubspecResolvedCommand extends PubCommand {
@override
String get name => 'ensure-pubspec-resolved';
Expand Down
Loading