From a0375afc4cfe317b34e5e04ae06879bc0d220cd0 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Wed, 7 Feb 2024 19:52:46 +0100 Subject: [PATCH] Fix typos. The wonders of in-IDE spell checking. Also ask for newest lints (no changes needed). --- CHANGELOG.md | 2 +- lib/src/discovery.dart | 8 ++++---- lib/src/package_config.dart | 8 ++++---- lib/src/package_config_impl.dart | 2 +- lib/src/packages_file.dart | 2 +- lib/src/util.dart | 2 +- pubspec.yaml | 2 +- test/package_config_impl_test.dart | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a682bc3..2870c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/src/discovery.dart b/lib/src/discovery.dart index 352bed8..b678410 100644 --- a/lib/src/discovery.dart +++ b/lib/src/discovery.dart @@ -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 findPackageConfig(Directory baseDirectory, @@ -46,7 +46,7 @@ Future 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. @@ -113,10 +113,10 @@ Future 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 findPackagConfigInDirectory(Directory directory, +Future findPackageConfigInDirectory(Directory directory, int minVersion, void Function(Object error) onError) async { var packageConfigFile = await checkForPackageConfigJsonFile(directory); if (packageConfigFile != null) { diff --git a/lib/src/package_config.dart b/lib/src/package_config.dart index c00ac67..155dfc5 100644 --- a/lib/src/package_config.dart +++ b/lib/src/package_config.dart @@ -26,7 +26,7 @@ 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), @@ -34,7 +34,7 @@ abstract class PackageConfig { /// /// 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. /// @@ -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); @@ -377,7 +377,7 @@ abstract class LanguageVersion implements Comparable { /// 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 { diff --git a/lib/src/package_config_impl.dart b/lib/src/package_config_impl.dart index d8e8d49..865e99a 100644 --- a/lib/src/package_config_impl.dart +++ b/lib/src/package_config_impl.dart @@ -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(), diff --git a/lib/src/packages_file.dart b/lib/src/packages_file.dart index f84db10..bf68f2c 100644 --- a/lib/src/packages_file.dart +++ b/lib/src/packages_file.dart @@ -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; diff --git a/lib/src/util.dart b/lib/src/util.dart index 3bf1bec..f1fa207 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -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. diff --git a/pubspec.yaml b/pubspec.yaml index 6ac7f54..9db82c6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 diff --git a/test/package_config_impl_test.dart b/test/package_config_impl_test.dart index 87d1fd4..0f39963 100644 --- a/test/package_config_impl_test.dart +++ b/test/package_config_impl_test.dart @@ -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);