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 typos. #147

Merged
merged 1 commit into from
Apr 11, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- Based on new JSON file format with more content.
- This version includes all the new functionality intended for a 2.0.0
version, as well as the, now deprecated, version 1 functionality.
When we release 2.0.0, the deprectated functionality will be removed.
When we release 2.0.0, the deprecated functionality will be removed.

## 1.1.0

Expand Down
8 changes: 4 additions & 4 deletions lib/src/discovery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final Uri parentPath = Uri(path: '..');
/// Returns `null` if no configuration was found. If a configuration
/// is needed, then the caller can supply [PackageConfig.empty].
///
/// If [minVersion] is greated than 1, `.packages` files are ignored.
/// If [minVersion] is greater than 1, `.packages` files are ignored.
/// If [minVersion] is greater than the version read from the
/// `package_config.json` file, it too is ignored.
Future<PackageConfig?> findPackageConfig(Directory baseDirectory,
Expand All @@ -46,7 +46,7 @@ Future<PackageConfig?> findPackageConfig(Directory baseDirectory,
do {
// Check for $cwd/.packages
var packageConfig =
await findPackagConfigInDirectory(directory, minVersion, onError);
await findPackageConfigInDirectory(directory, minVersion, onError);
if (packageConfig != null) return packageConfig;
if (!recursive) break;
// Check in parent directories.
Expand Down Expand Up @@ -113,10 +113,10 @@ Future<PackageConfig?> findPackageConfigUri(
/// a best-effort attempt is made to return a package configuration.
/// This may be the empty package configuration.
///
/// If [minVersion] is greated than 1, `.packages` files are ignored.
/// If [minVersion] is greater than 1, `.packages` files are ignored.
/// If [minVersion] is greater than the version read from the
/// `package_config.json` file, it too is ignored.
Future<PackageConfig?> findPackagConfigInDirectory(Directory directory,
Future<PackageConfig?> findPackageConfigInDirectory(Directory directory,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Consider making this private since it is not referenced outside this library.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will consider for a later cleanup.

int minVersion, void Function(Object error) onError) async {
var packageConfigFile = await checkForPackageConfigJsonFile(directory);
if (packageConfigFile != null) {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/package_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ abstract class PackageConfig {
/// is expected, but none have been specified or found.
static const PackageConfig empty = SimplePackageConfig.empty();

/// Creats a package configuration with the provided available [packages].
/// Creates a package configuration with the provided available [packages].
///
/// The packages must be valid packages (valid package name, valid
/// absolute directory URIs, valid language version, if any),
/// and there must not be two packages with the same name.
///
/// The package's root ([Package.root]) and package-root
/// ([Package.packageUriRoot]) paths must satisfy a number of constraints
/// We say that one path (which we know ends with a `/` charater)
/// We say that one path (which we know ends with a `/` character)
/// is inside another path, if the latter path is a prefix of the former path,
/// including the two paths being the same.
///
Expand Down Expand Up @@ -159,7 +159,7 @@ abstract class PackageConfig {

/// Look up a package by name.
///
/// Returns the [Package] fron [packages] with [packageName] as
/// Returns the [Package] from [packages] with [packageName] as
/// [Package.name]. Returns `null` if the package is not available in the
/// current configuration.
Package? operator [](String packageName);
Expand Down Expand Up @@ -377,7 +377,7 @@ abstract class LanguageVersion implements Comparable<LanguageVersion> {

/// An *invalid* language version.
///
/// Stored in a [Package] when the orginal language version string
/// Stored in a [Package] when the original language version string
/// was invalid and a `onError` handler was passed to the parser
/// which did not throw on an error.
abstract class InvalidLanguageVersion implements LanguageVersion {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/package_config_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class TriePackageTree implements PackageTree {
}

// For internal reasons we allow this (for now). One should still never do
// it thouh.
// it though.
// 3) The new package is inside the packageUriRoot of existing package.
if (_disallowPackagesInsidePackageUriRoot) {
if (_beginsWith(0, existingPackage.packageUriRoot.toString(),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/packages_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ PackageConfig parse(
}
if (packageNames.contains(packageName)) {
onError(PackageConfigFormatException(
'Same package name occured more than once', source, start));
'Same package name occurred more than once', source, start));
continue;
}
var rootUri = packageLocation;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ bool hasAbsolutePath(Uri uri) =>
/// the [baseUri], or if there is no overlap in the paths of the
/// two URIs at all, the [uri] is returned as-is.
///
/// Otherwise the result is a path-only URI which satsifies
/// Otherwise the result is a path-only URI which satisfies
/// `baseUri.resolveUri(result) == uri`,
///
/// The `baseUri` must be absolute.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies:
path: ^1.8.0

dev_dependencies:
dart_flutter_team_lints: ^2.0.0
dart_flutter_team_lints: ^2.1.0
test: ^1.16.0
2 changes: 1 addition & 1 deletion test/package_config_impl_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void main() {
});

group('package config', () {
test('emtpy', () {
test('empty', () {
var empty = PackageConfig([], extraData: unique);
expect(empty.version, 2);
expect(empty.packages, isEmpty);
Expand Down