Skip to content

Commit 5601eab

Browse files
jensjohacommit-bot@chromium.org
authored andcommitted
[CFE] Spell check messages and dart code
This CL adds a simple spell-checker, adds a spell-checking-phase to messages_test to spell-check our messages, adds a new test that spell-check our dart-code and fixes a lot of spelling mistakes / typos. Change-Id: I8943a5bd67970e9a8a775251ae0aa97799eab097 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112346 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent a347973 commit 5601eab

File tree

70 files changed

+4547
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4547
-171
lines changed

pkg/front_end/lib/src/api_prototype/compiler_options.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CompilerOptions {
7676

7777
/// URI of the SDK summary file (typically a "file:" URI).
7878
///
79-
/// This should should be a summary previosly generated by this package (and
79+
/// This should should be a summary previously generated by this package (and
8080
/// not the similarly named summary files from `package:analyzer`.)
8181
///
8282
/// If `null` and [compileSdk] is false, the SDK summary will be searched for
@@ -161,8 +161,8 @@ class CompilerOptions {
161161
/// tracking).
162162
///
163163
/// Messages are printed on stdout.
164-
// TODO(sigmund): improve the diagnotics API to provide mechanism to intercept
165-
// verbose data (Issue #30056)
164+
// TODO(sigmund): improve the diagnostics API to provide mechanism to
165+
// intercept verbose data (Issue #30056)
166166
bool verbose = false;
167167

168168
/// Whether to run extra verification steps to validate that compiled

pkg/front_end/lib/src/api_prototype/kernel_generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Future<CompilerResult> kernelForProgramInternal(
7070
///
7171
/// A build unit is a collection of libraries that are compiled together.
7272
/// Libraries in the build unit may depend on each other and may have
73-
/// dependencies to libraries in other build units. Unlinke library
73+
/// dependencies to libraries in other build units. Unlinked library
7474
/// dependencies, build unit dependencies must be acyclic.
7575
///
7676
/// This API is intended for modular compilation. Dependencies to other build

pkg/front_end/lib/src/api_unstable/bazel_worker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
130130
// won't be able to link to it when loading more outlines.
131131
sdkComponent.adoptChildren();
132132

133-
// TODO(jensj): This is - at least currently - neccessary,
133+
// TODO(jensj): This is - at least currently - necessary,
134134
// although it's not entirely obvious why.
135135
// It likely has to do with several outlines containing the same libraries.
136136
// Once that stops (and we check for it) we can probably remove this,

pkg/front_end/lib/src/base/processed_options.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class ProcessedOptions {
344344
if (_inputSummariesComponents == null) {
345345
var uris = _raw.inputSummaries;
346346
if (uris == null || uris.isEmpty) return const <Component>[];
347-
// TODO(sigmund): throttle # of concurrent opreations.
347+
// TODO(sigmund): throttle # of concurrent operations.
348348
var allBytes = await Future.wait(
349349
uris.map((uri) => _readAsBytes(fileSystem.entityForUri(uri))));
350350
_inputSummariesComponents =
@@ -366,7 +366,7 @@ class ProcessedOptions {
366366
if (_linkedDependencies == null) {
367367
var uris = _raw.linkedDependencies;
368368
if (uris == null || uris.isEmpty) return const <Component>[];
369-
// TODO(sigmund): throttle # of concurrent opreations.
369+
// TODO(sigmund): throttle # of concurrent operations.
370370
var allBytes = await Future.wait(
371371
uris.map((uri) => _readAsBytes(fileSystem.entityForUri(uri))));
372372
_linkedDependencies =
@@ -462,7 +462,7 @@ class ProcessedOptions {
462462

463463
var input = inputs.first;
464464

465-
// When compiling the SDK the input files are normaly `dart:` URIs.
465+
// When compiling the SDK the input files are normally `dart:` URIs.
466466
if (input.scheme == 'dart') return _packages = Packages.noPackages;
467467

468468
if (input.scheme == 'packages') {
@@ -562,7 +562,7 @@ class ProcessedOptions {
562562

563563
/// Ensure [_sdkRoot], [_sdkSummary] and [_librarySpecUri] are initialized.
564564
///
565-
/// If they are not set explicitly, they are infered based on the default
565+
/// If they are not set explicitly, they are inferred based on the default
566566
/// behavior described in [CompilerOptions].
567567
void _ensureSdkDefaults() {
568568
if (_computedSdkDefaults) return;

pkg/front_end/lib/src/fasta/builder/class_builder.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,9 +1424,9 @@ abstract class ClassBuilder extends TypeDeclarationBuilder {
14241424

14251425
void checkMixinDeclaration() {
14261426
assert(cls.isMixinDeclaration);
1427-
for (Builder constructory in constructors.local.values) {
1428-
if (!constructory.isSynthetic &&
1429-
(constructory.isFactory || constructory.isConstructor)) {
1427+
for (Builder constructor in constructors.local.values) {
1428+
if (!constructor.isSynthetic &&
1429+
(constructor.isFactory || constructor.isConstructor)) {
14301430
addProblem(
14311431
templateIllegalMixinDueToConstructors
14321432
.withArguments(fullNameForErrors),
@@ -1436,7 +1436,7 @@ abstract class ClassBuilder extends TypeDeclarationBuilder {
14361436
templateIllegalMixinDueToConstructorsCause
14371437
.withArguments(fullNameForErrors)
14381438
.withLocation(
1439-
constructory.fileUri, constructory.charOffset, noLength)
1439+
constructor.fileUri, constructor.charOffset, noLength)
14401440
]);
14411441
}
14421442
}

pkg/front_end/lib/src/fasta/builder/procedure_builder.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ abstract class FunctionBuilder extends MemberBuilder {
157157
bool get isFactory => identical(ProcedureKind.Factory, kind);
158158

159159
/// This is the formal parameter scope as specified in the Dart Programming
160-
/// Language Specifiction, 4th ed, section 9.2.
160+
/// Language Specification, 4th ed, section 9.2.
161161
Scope computeFormalParameterScope(Scope parent) {
162162
if (formals == null) return parent;
163163
Map<String, Builder> local = <String, Builder>{};
@@ -196,7 +196,7 @@ abstract class FunctionBuilder extends MemberBuilder {
196196
}
197197

198198
/// This scope doesn't correspond to any scope specified in the Dart
199-
/// Programming Language Specifiction, 4th ed. It's an unspecified extension
199+
/// Programming Language Specification, 4th ed. It's an unspecified extension
200200
/// to support generic methods.
201201
Scope computeTypeParameterScope(Scope parent) {
202202
if (typeVariables == null) return parent;

pkg/front_end/lib/src/fasta/colors.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// TODO(ahe): Orignially copied from sdk/pkg/compiler/lib/src/colors.dart,
5+
// TODO(ahe): Originally copied from sdk/pkg/compiler/lib/src/colors.dart,
66
// merge these two packages.
77
library colors;
88

pkg/front_end/lib/src/fasta/fasta_codes_generated.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ const Code<Null> codeConstructorCyclic = messageConstructorCyclic;
18321832
const MessageCode messageConstructorCyclic = const MessageCode(
18331833
"ConstructorCyclic",
18341834
analyzerCodes: <String>["RECURSIVE_CONSTRUCTOR_REDIRECT"],
1835-
message: r"""Redirecting constructers can't be cyclic.""",
1835+
message: r"""Redirecting constructors can't be cyclic.""",
18361836
tip:
18371837
r"""Try to have all constructors eventually redirect to a non-redirecting constructor.""");
18381838

@@ -2700,7 +2700,8 @@ Message _withArgumentsDuplicatedLibraryImportContext(String name) {
27002700
const Template<Message Function(Token token)> templateDuplicatedModifier =
27012701
const Template<Message Function(Token token)>(
27022702
messageTemplate: r"""The modifier '#lexeme' was already specified.""",
2703-
tipTemplate: r"""Try removing all but one occurence of the modifier.""",
2703+
tipTemplate:
2704+
r"""Try removing all but one occurrence of the modifier.""",
27042705
withArguments: _withArgumentsDuplicatedModifier);
27052706

27062707
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -2714,7 +2715,7 @@ Message _withArgumentsDuplicatedModifier(Token token) {
27142715
String lexeme = token.lexeme;
27152716
return new Message(codeDuplicatedModifier,
27162717
message: """The modifier '${lexeme}' was already specified.""",
2717-
tip: """Try removing all but one occurence of the modifier.""",
2718+
tip: """Try removing all but one occurrence of the modifier.""",
27182719
arguments: {'token': token});
27192720
}
27202721

@@ -3615,7 +3616,7 @@ const MessageCode messageFastaUsageLong =
36153616
36163617
When specified, the compiler can be invoked with inputs using the custom
36173618
URI scheme. The compiler can ignore the exact location of files on disk
3618-
and as a result to produce output that is independendent of the absolute
3619+
and as a result to produce output that is independent of the absolute
36193620
location of files on disk. This is mostly useful for integrating with
36203621
build systems.
36213622

pkg/front_end/lib/src/fasta/hybrid_file_system.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import '../api_prototype/memory_file_system.dart';
1313
import '../api_prototype/standard_file_system.dart';
1414

1515
/// A file system that mixes files from memory and a physical file system. All
16-
/// memory entities take priotity over file system entities.
16+
/// memory entities take priority over file system entities.
1717
class HybridFileSystem implements FileSystem {
1818
final MemoryFileSystem memory;
1919
final FileSystem physical;
@@ -26,7 +26,7 @@ class HybridFileSystem implements FileSystem {
2626
new HybridFileSystemEntity(uri, this);
2727
}
2828

29-
/// Entity that delegates to an underlying memory or phisical file system
29+
/// Entity that delegates to an underlying memory or physical file system
3030
/// entity.
3131
class HybridFileSystemEntity implements FileSystemEntity {
3232
final Uri uri;

pkg/front_end/lib/src/fasta/incremental_compiler.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
357357
}
358358
}
359359

360-
updateNeededDillLibraresWithHierarchy(
360+
updateNeededDillLibrariesWithHierarchy(
361361
hierarchy, userCode.loader.builderHierarchy);
362362
}
363363

@@ -439,7 +439,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
439439
/// TODO(jensj): This could probably be a utility method somewhere instead
440440
/// (though handling of the case where all bets are off should probably still
441441
/// live locally).
442-
void updateNeededDillLibraresWithHierarchy(
442+
void updateNeededDillLibrariesWithHierarchy(
443443
ClassHierarchy hierarchy, ClassHierarchyBuilder builderHierarchy) {
444444
if (hierarchy is ClosedWorldClassHierarchy && !hierarchy.allBetsOff) {
445445
neededDillLibraries ??= new Set<Library>();

0 commit comments

Comments
 (0)