Correct misspelled English words in comments and printed messages in Bazel's src/... directory (and run fix)

RELNOTES: None.
PiperOrigin-RevId: 222473871
diff --git a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ImportDepsChecker.java b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ImportDepsChecker.java
index 1e660a3..7429a88 100644
--- a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ImportDepsChecker.java
+++ b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ImportDepsChecker.java
@@ -82,7 +82,7 @@
   }
 
   /**
-   * Checks for dependency problems in the given input jars agains the classpath.
+   * Checks for dependency problems in the given input jars against the classpath.
    *
    * @return {@literal true} for no problems, {@literal false} otherwise.
    */
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java
index c3c63b2..518b345 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java
@@ -165,8 +165,8 @@
   }
 
   /**
-   * Creates a {@link HashSet} instance, with a high enough "intial capcity" that it <em>should</em>
-   * hold {@code expectedSize} elements without growth.
+   * Creates a {@link HashSet} instance, with a high enough "initial capcity" that it
+   * <em>should</em> hold {@code expectedSize} elements without growth.
    */
   private static <T> HashSet<T> newHashSetWithExpectedSize(int expectedSize) {
     return new HashSet<T>(calculateInitialCapacity(expectedSize));
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
index 1e2aaf0..8531cd3 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
@@ -193,9 +193,10 @@
     }
 
     /**
-     * Sets the name of the icon. This is optional; if not set it will instead use the value
-     * pased to {@link #setIconUrl(String)}.
-     * @param  iconName name of the icon.
+     * Sets the name of the icon. This is optional; if not set it will instead use the value passed
+     * to {@link #setIconUrl(String)}.
+     *
+     * @param iconName name of the icon.
      * @return Builder
      */
     public Builder setIconName(String iconName) {
diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/SimpleFileSystem.java b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/SimpleFileSystem.java
index 5ef83e1..300b4f5 100644
--- a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/SimpleFileSystem.java
+++ b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/SimpleFileSystem.java
@@ -15,7 +15,6 @@
 package com.google.devtools.build.singlejar;
 
 import com.google.devtools.build.singlejar.OptionFileExpander.OptionFileProvider;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -41,9 +40,6 @@
    */
   File getFile(String filename) throws IOException;
 
-  /**
-   * Delete the file with the given name and return whether deleting it was
-   * successfull.
-   */
+  /** Delete the file with the given name and return whether deleting it was successful. */
   boolean delete(String filename);
 }
\ No newline at end of file
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 9cad059..8161429 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -146,7 +146,7 @@
 //   to deliver a SIGKILL to the server after three SIGINTs. It would only be
 //   possible with gRPC anyway.
 //
-// - Have the server check that the PID file containts the correct things
+// - Have the server check that the PID file contains the correct things
 //   before deleting them: there is a window of time between checking the file
 //   and deleting it in which a new server can overwrite the PID file. The
 //   output base lock cannot be acquired, either, because when starting up a
diff --git a/src/main/cpp/global_variables.h b/src/main/cpp/global_variables.h
index 6baa6a9..ca9b00e 100644
--- a/src/main/cpp/global_variables.h
+++ b/src/main/cpp/global_variables.h
@@ -73,7 +73,7 @@
   // The path of the JVM executable that should be used to launch Blaze.
   std::string jvm_path;
 
-  // TODO(laszlocsomor) 2016-11-28: move pid_t usage out of here and whereever
+  // TODO(laszlocsomor) 2016-11-28: move pid_t usage out of here and wherever
   // else it appears. Find some way to not have to declare a pid_t here, either
   // by making PID handling platform-independent or some other idea.
   pid_t server_pid;
diff --git a/src/main/cpp/option_processor.cc b/src/main/cpp/option_processor.cc
index 04f7f4f..4e4f630 100644
--- a/src/main/cpp/option_processor.cc
+++ b/src/main/cpp/option_processor.cc
@@ -273,7 +273,7 @@
         BAZEL_LOG(WARNING)
             << "Duplicate rc file: " << loaded_rc
             << " is read multiple times, it is a standard rc file location "
-               "but must have been unnecessarilly imported earlier.";
+               "but must have been unnecessarily imported earlier.";
       } else {
         BAZEL_LOG(WARNING)
             << "Duplicate rc file: " << loaded_rc
@@ -487,7 +487,7 @@
   StartupOptions* parsed_startup_options = GetParsedStartupOptions();
 
   // Print the startup flags in the order they are parsed, to keep the
-  // precendence clear. In order to minimize the number of lines of output in
+  // precedence clear. In order to minimize the number of lines of output in
   // the terminal, group sequential flags by origin. Note that an rc file may
   // turn up multiple times in this list, if, for example, it imports another
   // rc file and contains startup options on either side of the import
diff --git a/src/main/cpp/util/port.h b/src/main/cpp/util/port.h
index fa5a600..efd0b95 100644
--- a/src/main/cpp/util/port.h
+++ b/src/main/cpp/util/port.h
@@ -137,7 +137,7 @@
 
 #ifdef _WIN32
 // TODO(laszlocsomor) 2016-11-28: move pid_t usage out of global_variables.h and
-// whereever else it appears. Find some way to not have to declare a pid_t here,
+// wherever else it appears. Find some way to not have to declare a pid_t here,
 // either by making PID handling platform-independent or some other idea; remove
 // the following typedef afterwards.
 typedef int pid_t;
diff --git a/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java b/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java
index bd1fdf5..b353a9c 100644
--- a/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java
+++ b/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java
@@ -147,16 +147,16 @@
    * Creates a map of rule names (keys) to rule documentation (values).
    *
    * <p>This method crawls the specified input directories for rule class definitions (as Java
-   * source files) which contain the rules' and attributes' definitions as comments in a
-   * specific format. The keys in the returned Map correspond to these rule classes.
+   * source files) which contain the rules' and attributes' definitions as comments in a specific
+   * format. The keys in the returned Map correspond to these rule classes.
    *
    * <p>In the Map's values, all references pointing to other rules, rule attributes, and general
-   * documentation (e.g. common definitions, make variables, etc.) are expanded into hyperlinks.
-   * The links generated follow the multi-page Build Encyclopedia model (one page per rule clas.).
+   * documentation (e.g. common definitions, make variables, etc.) are expanded into hyperlinks. The
+   * links generated follow the multi-page Build Encyclopedia model (one page per rule class.).
    *
    * @param inputDirs list of directories to scan for documentation
-   * @param blackList specify an optional blacklist file that list some rules that should
-   *                  not be listed in the output.
+   * @param blackList specify an optional blacklist file that list some rules that should not be
+   *     listed in the output.
    * @throws BuildEncyclopediaDocException
    * @throws IOException
    * @return Map of rule class to rule documentation.
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
index e528c5d..355d0b2 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
@@ -186,7 +186,7 @@
         actionBuilder.addAllCommandLine(((CommandAction) action).getArguments());
       }
     } catch (CommandLineExpansionException e) {
-      // Command-line not avaiable, so just not report it
+      // Command-line not available, so just not report it
       logger.log(Level.INFO, "Could no compute commandline of reported action", e);
     }
     return GenericBuildEvent.protoChaining(this).setAction(actionBuilder.build()).build();
diff --git a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
index 92c6546..1ed8df5 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java
@@ -752,7 +752,7 @@
     } else {
       // Derived Artifact: path and root are under execRoot
       //
-      // TODO(blaze-team): this is misleading beacuse execution_root isn't unique. Dig the
+      // TODO(blaze-team): this is misleading because execution_root isn't unique. Dig the
       // workspace name out and print that also.
       return "[[<execution_root>]" + root.getExecPath() + "]" + rootRelativePath;
     }
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ExecutionInfoSpecifier.java b/src/main/java/com/google/devtools/build/lib/actions/ExecutionInfoSpecifier.java
index e7038a0..146f2db 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ExecutionInfoSpecifier.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ExecutionInfoSpecifier.java
@@ -22,9 +22,9 @@
 public interface ExecutionInfoSpecifier {
 
   /**
-   * Returns execution data for this action.  This is used to signal hardware requirements to the
-   * execution (ex. "requires-darwin").  This is a workaround to allow execution on platforms other
-   * than that specified by the host configuration.  The ability to choose seperate platforms by
+   * Returns execution data for this action. This is used to signal hardware requirements to the
+   * execution (ex. "requires-darwin"). This is a workaround to allow execution on platforms other
+   * than that specified by the host configuration. The ability to choose separate platforms by
    * action can provide a performance advantage.
    *
    * <p>Restrictions are mapped to arbitrary values (typically "") so as to be consistent with
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AspectCollection.java b/src/main/java/com/google/devtools/build/lib/analysis/AspectCollection.java
index f95340c..432416d 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/AspectCollection.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/AspectCollection.java
@@ -352,11 +352,11 @@
   }
 
   /**
-   * Signals an inconsistency on aspect path: an aspect occurs twice on the path and
-   * the second occurrence sees a different set of aspects.
+   * Signals an inconsistency on aspect path: an aspect occurs twice on the path and the second
+   * occurrence sees a different set of aspects.
    *
-   * {@link #getAspect()} is the aspect occuring twice, and {@link #getPreviousAspect()}
-   * is the aspect that the second occurrence sees but the first does not.
+   * <p>{@link #getAspect()} is the aspect occurring twice, and {@link #getPreviousAspect()} is the
+   * aspect that the second occurrence sees but the first does not.
    */
   public static class AspectCycleOnPathException extends Exception {
 
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
index 375e347..1d8e23f 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
@@ -845,7 +845,7 @@
 
     /**
      * @deprecated Use {@link #addTransitiveArtifacts} instead, to prevent increased memory use.
-     *     <p>See alse {@link Builder#addTransitiveArtifactsWrappedInStableOrder}
+     *     <p>See also {@link Builder#addTransitiveArtifactsWrappedInStableOrder}
      */
     @Deprecated
     public Builder addArtifacts(NestedSet<Artifact> artifacts) {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/TransitiveInfoProviderEffectiveClassHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/TransitiveInfoProviderEffectiveClassHelper.java
index af1fe23..bc3ef54 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/TransitiveInfoProviderEffectiveClassHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/TransitiveInfoProviderEffectiveClassHelper.java
@@ -25,7 +25,7 @@
 
 /**
  * Provides the effective class for the provider. The effective class is inferred as the sole class
- * in the provider's inheritence hierarchy that implements {@link TransitiveInfoProvider} directly.
+ * in the provider's inheritance hierarchy that implements {@link TransitiveInfoProvider} directly.
  * This allows for simple subclasses such as those created by AutoValue, but will fail if there's
  * any ambiguity as to which implementor of the {@link TransitiveInfoProvider} is intended. If the
  * provider implements multiple TransitiveInfoProvider interfaces, prefer the explicit put builder
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/Substitution.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/Substitution.java
index f75e5e6..8232133 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/Substitution.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/Substitution.java
@@ -149,7 +149,7 @@
   /**
    * Expands a fragment value.
    *
-   * <p>This is slighly more memory efficient since it defers the expansion of the path fragment's
+   * <p>This is slightly more memory efficient since it defers the expansion of the path fragment's
    * string until requested. Often a template action is never executed, meaning the string is never
    * needed.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index 1af93d2..bef6476 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -1572,12 +1572,11 @@
    * Returns a new, unordered mapping of names to values of "Make" variables defined by this
    * configuration.
    *
-   * <p>This does *not* include package-defined overrides (e.g. vardef)
-   * and so should not be used by the build logic.  This is used only for
-   * the 'info' command.
+   * <p>This does *not* include package-defined overrides (e.g. vardef) and so should not be used by
+   * the build logic. This is used only for the 'info' command.
    *
-   * <p>Command-line definitions of make enviroments override variables defined by
-   * {@code Fragment.addGlobalMakeVariables()}.
+   * <p>Command-line definitions of make environments override variables defined by {@code
+   * Fragment.addGlobalMakeVariables()}.
    */
   public Map<String, String> getMakeEnvironment() {
     Map<String, String> makeEnvironment = new HashMap<>();
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransition.java b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransition.java
index 8995bf6..3ae4d98 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransition.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransition.java
@@ -29,12 +29,12 @@
   List<BuildOptions> apply(BuildOptions buildOptions);
 
   /**
-   * We want to keep the number of transition interfaces no larger than what's necessary to
-   * maintain a clear configuration API.
+   * We want to keep the number of transition interfaces no larger than what's necessary to maintain
+   * a clear configuration API.
    *
    * <p>This method provides a speed bump against creating new interfaces too casually. While we
    * could provide stronger enforcement by making {@link ConfigurationTransition} an abstract class
-   * with a limited access constructor, keeping it as an interface supports definining transitions
+   * with a limited access constructor, keeping it as an interface supports defining transitions
    * with lambdas.
    *
    * <p>If you're considering adding a new override, contact bazel-dev@googlegroups.com to discuss.
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
index 0579f7d..2e78555 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
@@ -292,9 +292,9 @@
         == TestActionBuilder.TestShardingStrategy.EXPERIMENTAL_HEURISTIC) {
       reporter.handle(
           Event.warn(
-              "Heuristic sharding is intended as a one-off experimentation tool for determing the "
-                  + "benefit from sharding certain tests. Please don't keep this option in your "
-                  + ".blazerc or continuous build"));
+              "Heuristic sharding is intended as a one-off experimentation tool for determining "
+                  + "the benefit from sharding certain tests. Please don't keep this option in "
+                  + "your .blazerc or continuous build"));
     }
   }
 
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/commands/SyncCommand.java b/src/main/java/com/google/devtools/build/lib/bazel/commands/SyncCommand.java
index 4f97453..9725eee 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/commands/SyncCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/commands/SyncCommand.java
@@ -48,12 +48,12 @@
 import java.util.HashSet;
 import java.util.Set;
 
-/** Syncs all repositories specifed in the workspace file */
+/** Syncs all repositories specified in the workspace file */
 @Command(
     name = SyncCommand.NAME,
     options = {PackageCacheOptions.class, KeepGoingOption.class, LoadingPhaseThreadsOption.class},
     help = "resource:sync.txt",
-    shortDescription = "Syncs all repositories specifed in the workspace file",
+    shortDescription = "Syncs all repositories specified in the workspace file",
     allowResidue = false)
 public final class SyncCommand implements BlazeCommand {
   public static final String NAME = "sync";
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
index fbe2348..8e46218 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
@@ -114,7 +114,7 @@
       help =
           "If list of repository rules for which the hash of the output directory should be"
               + " verified, provided a file is specified by"
-              + " --experimental_respository_hash_file.")
+              + " --experimental_repository_hash_file.")
   public List<String> experimentalVerifyRepositoryRules;
 
   @Option(
@@ -122,7 +122,7 @@
       defaultValue = "",
       documentationCategory = OptionDocumentationCategory.GENERIC_INPUTS,
       effectTags = {OptionEffectTag.CHANGES_INPUTS},
-      help = "If non-empty read the specifed resolved file instead of the WORKSPACE file")
+      help = "If non-empty read the specified resolved file instead of the WORKSPACE file")
   public String experimentalResolvedFileInsteadOfWorkspace;
 
   /**
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/ChainableEvent.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/ChainableEvent.java
index 3fdf22c..8929624 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventstream/ChainableEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/ChainableEvent.java
@@ -21,7 +21,7 @@
  *
  * <p>When objects that are naturally organised in a directed acyclic graph are sent sequentially
  * over some channel, the graph-structure needs to represented in some way. We chose the
- * representation that each node knows its immediate sucessor nodes (rather than its predecessors)
+ * representation that each node knows its immediate successor nodes (rather than its predecessors)
  * to suit the * properties of the event stream: new parents of a node might be discovered late,
  * e.g., if a test suite is only expanded after one of its tests is already finished as it was also
  * needed for another target.
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
index 70e7b8e..308c637 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
@@ -113,7 +113,7 @@
       @Override
       public String getLinkName(
           String symlinkPrefix, String productName, String workspaceBaseName) {
-        // TODO(b/35234395): This symlink is created for backwards compatiblity, remove it once
+        // TODO(b/35234395): This symlink is created for backwards compatibility, remove it once
         // we're sure it won't cause any other issues.
         return productName + "-out";
       }
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java b/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java
index d74c055..64ad76b 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java
@@ -76,11 +76,10 @@
   }
 
   /**
-   * Creates a presentable description of this aspect, avaliable
-   * to Skylark via "Target.aspects".
+   * Creates a presentable description of this aspect, available to Skylark via "Target.aspects".
    *
-   * The description is designed to be unique for each aspect descriptor,
-   * but not to be parseable.
+   * <p>The description is designed to be unique for each aspect descriptor, but not to be
+   * parseable.
    */
   public String getDescription() {
     if (aspectParameters.isEmpty()) {
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java b/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
index 86f11e3..141313f 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
@@ -90,8 +90,8 @@
   }
 
   /**
-   * Returns true iff the value of the specified attribute is explicitly set in the BUILD file.
-   * This returns true also if the value explicity specified in the BUILD file is the same as the
+   * Returns true iff the value of the specified attribute is explicitly set in the BUILD file. This
+   * returns true also if the value explicitly specified in the BUILD file is the same as the
    * attribute's default value. In addition, this method return false if the rule has no attribute
    * with the given name.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/packages/BuildType.java b/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
index 5bb365d..d2c93f4 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
@@ -308,7 +308,7 @@
     public Map<Label, ValueT> convert(Object x, Object what, Object context)
         throws ConversionException {
       Map<Label, ValueT> result = super.convert(x, what, context);
-      // The input is known to be a map because super.convert succeded; otherwise, a
+      // The input is known to be a map because super.convert succeeded; otherwise, a
       // ConversionException would have been thrown.
       Map<?, ?> input = (Map<?, ?>) x;
 
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Rule.java b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
index 00ee63e..0c805da 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Rule.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
@@ -312,8 +312,8 @@
   }
 
   /**
-   * Returns true iff the value of the specified attribute is explicitly set in the BUILD file.
-   * This returns true also if the value explicity specified in the BUILD file is the same as the
+   * Returns true iff the value of the specified attribute is explicitly set in the BUILD file. This
+   * returns true also if the value explicitly specified in the BUILD file is the same as the
    * attribute's default value. In addition, this method return false if the rule has no attribute
    * with the given name.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java b/src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java
index 06371f8..4726340 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java
@@ -23,10 +23,9 @@
 import java.util.List;
 
 /**
- * A buildfiles(x) query expression, which computes the set of BUILD files and
- * subincluded files for each target in set x.  The result is unordered.  This
- * operator is typically used for determinining what files or packages to check
- * out.
+ * A buildfiles(x) query expression, which computes the set of BUILD files and subincluded files for
+ * each target in set x. The result is unordered. This operator is typically used for determining
+ * what files or packages to check out.
  *
  * <pre>expr ::= BUILDFILES '(' expr ')'</pre>
  */
diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java
index b8c0de8..eb644ff 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java
@@ -187,7 +187,7 @@
    * <p>The benefit of using a streamed formatter is that we can save the potentially expensive
    * subgraph extraction step before presenting the query results and that depending on the query
    * environment used, it can be more memory performant, as it does not aggregate all the data
-   * before writting in the output.
+   * before writing in the output.
    */
   public interface StreamedFormatter {
     /** Specifies options to be used by subsequent calls to {@link #createStreamCallback}. */
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java
index ac13b85..383bb21 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppModuleMap.java
@@ -56,7 +56,7 @@
    * Returns an optional umbrella header artifact. The headers declared in module maps are compiled
    * using the #import directives which are incompatible with J2ObjC segmented headers. The headers
    * generated by J2ObjC need to be compiled using the #include directives. We can #include all the
-   * headers in an umbrella header and then delcare the umbrella header in the module map.
+   * headers in an umbrella header and then declare the umbrella header in the module map.
    */
   public Optional<Artifact> getUmbrellaHeader() {
     return umbrellaHeader;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java
index bf29c19..c9d84c4 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileActionBuilder.java
@@ -317,7 +317,7 @@
     }
 
     // If we get here the action requires annotation processing, so add additional inputs and
-    // flags needed for the javac-based header compiler implementatino that supports
+    // flags needed for the javac-based header compiler implementations that supports
     // annotation processing.
 
     builder.addTransitiveInputs(classpathEntries);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java b/src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java
index 8d41063..bc7b2db 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java
@@ -646,8 +646,8 @@
   }
 
   /**
-   * Returns the prefix to be added to all generated artifact names, can be null. This is useful
-   * to disambiguate artifacts for multiple bundles created with different names withing same rule. 
+   * Returns the prefix to be added to all generated artifact names, can be null. This is useful to
+   * disambiguate artifacts for multiple bundles created with different names within same rule.
    */
   public String getArtifactPrefix() {
     return artifactPrefix;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
index 7c79a11..85eaf75 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
@@ -226,7 +226,7 @@
   }
 
   /**
-   * Lipo'ed dynamic library generated by combining one or more single-architecure linked dynamic
+   * Lipo'ed dynamic library generated by combining one or more single-architecture linked dynamic
    * libraries.
    */
   public Artifact combinedArchitectureDylib() {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java
index 468a2fe..045c80b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java
@@ -231,14 +231,13 @@
   public boolean deviceDebugEntitlements;
 
   @Option(
-    name = "objc_use_dotd_pruning",
-    defaultValue = "true",
-    documentationCategory = OptionDocumentationCategory.BUILD_TIME_OPTIMIZATION,
-    effectTags = {OptionEffectTag.CHANGES_INPUTS, OptionEffectTag.LOADING_AND_ANALYSIS},
-    help =
-        "If set, .d files emited by clang will be used to prune the set of inputs passed into objc "
-            + "compiles."
-  )
+      name = "objc_use_dotd_pruning",
+      defaultValue = "true",
+      documentationCategory = OptionDocumentationCategory.BUILD_TIME_OPTIMIZATION,
+      effectTags = {OptionEffectTag.CHANGES_INPUTS, OptionEffectTag.LOADING_AND_ANALYSIS},
+      help =
+          "If set, .d files emitted by clang will be used to prune the set of inputs passed into "
+              + "objc compiles.")
   public boolean useDotdPruning;
 
   @Option(
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandLogModule.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandLogModule.java
index fc56e55..40197b1 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommandLogModule.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandLogModule.java
@@ -95,8 +95,9 @@
    */
   public static final class CommandLogInfoItem extends InfoItem {
     public CommandLogInfoItem() {
-      super("command_log",
-          "Location of the log containg the output from the build commands.",
+      super(
+          "command_log",
+          "Location of the log containing the output from the build commands.",
           false);
     }
 
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java
index 4adf837..ac7a2b8 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java
@@ -602,7 +602,7 @@
     }
     if (event.getStdOut() == null && event.getStdErr() == null) {
       // We deduplicate on the attached output (assuming the event itself only describes
-      // the source of the output). If no output is attached it is a differnt kind of event
+      // the source of the output). If no output is attached it is a different kind of event
       // and should not be deduplicated.
       return false;
     }
@@ -686,7 +686,7 @@
   @Subscribe
   public void buildComplete(BuildCompleteEvent event) {
     // The final progress bar will flow into the scroll-back buffer, to if treat
-    // it as an event and add a timestamp, if events are supposed to have a timestmap.
+    // it as an event and add a timestamp, if events are supposed to have a timestamp.
     boolean done = false;
     synchronized (this) {
       stateTracker.buildComplete(event);
@@ -963,10 +963,7 @@
     startUpdateThread();
   }
 
-  /**
-   * Decide wheter the progress bar should be redrawn only for the reason
-   * that time has passed.
-   */
+  /** Decide whether the progress bar should be redrawn only for the reason that time has passed. */
   private synchronized boolean timeBasedRefresh() {
     if (!stateTracker.progressBarTimeDependent()) {
       return false;
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStream.java b/src/main/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStream.java
index 6f7562c..a965805 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStream.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStream.java
@@ -20,13 +20,12 @@
 import java.io.OutputStream;
 
 /**
- * {@link OutputStream} suitably synchronized for producer-consumer use cases.
- * The method {@link #readAndReset()} allows to read the bytes accumulated so far
- * and simultaneously truncate precisely the bytes read. Moreover, upon such a reset
- * the amount of memory retained is reset to a small constant. This is a difference
- * with resecpt to the behaviour of the standard classes {@link ByteArrayOutputStream}
- * which only resets the index but keeps the array. This difference matters, as we need
- * to support output peeks without retaining this ammount of memory for the rest of the
+ * {@link OutputStream} suitably synchronized for producer-consumer use cases. The method {@link
+ * #readAndReset()} allows to read the bytes accumulated so far and simultaneously truncate
+ * precisely the bytes read. Moreover, upon such a reset the amount of memory retained is reset to a
+ * small constant. This is a difference with resecpt to the behaviour of the standard classes {@link
+ * ByteArrayOutputStream} which only resets the index but keeps the array. This difference matters,
+ * as we need to support output peeks without retaining this amount of memory for the rest of the
  * build.
  *
  * <p>This class is expected to be used with the {@link BuildEventStreamer}.
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
index 8b42274..1b0af99 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
@@ -191,7 +191,7 @@
             "exec >&- 2>&- <&- && (/usr/bin/setsid /bin/rm -rf %s &)&",
             ShellEscaper.escapeString(tempPath.getPathString()));
 
-    logger.info("Executing shell commmand " + ShellEscaper.escapeString(command));
+    logger.info("Executing shell command " + ShellEscaper.escapeString(command));
 
     // Doesn't throw iff command exited and was successful.
     new CommandBuilder()
diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
index 60227cb..2374da9 100644
--- a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
+++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
@@ -551,19 +551,18 @@
    * lock file, and there is a small possibility of the following sequence of events:
    *
    * <ol>
-   *   <li> Client 1 runs "blaze clean --expunge"
-   *   <li> Client 2 runs a command and waits for client 1 to finish
-   *   <li> The clean command deletes everything including the lock file
-   *   <li> Client 2 starts running and since the output base is empty, starts up a new server,
-   *     which creates its own socket and PID files
-   *   <li> The server used by client runs its shutdown hooks, deleting the PID files created by
-   *     the new server
+   *   <li>Client 1 runs "blaze clean --expunge"
+   *   <li>Client 2 runs a command and waits for client 1 to finish
+   *   <li>The clean command deletes everything including the lock file
+   *   <li>Client 2 starts running and since the output base is empty, starts up a new server, which
+   *       creates its own socket and PID files
+   *   <li>The server used by client runs its shutdown hooks, deleting the PID files created by the
+   *       new server
    * </ol>
    *
    * It also disables the "die when the PID file changes" handler so that it doesn't kill the server
-   * while the "clean --expunge" commmand is running.
+   * while the "clean --expunge" command is running.
    */
-
   @Override
   public void prepareForAbruptShutdown() {
     disableShutdownHooks();
diff --git a/src/main/java/com/google/devtools/build/lib/shell/InputStreamSink.java b/src/main/java/com/google/devtools/build/lib/shell/InputStreamSink.java
index 8e8f54f..ac94d59 100644
--- a/src/main/java/com/google/devtools/build/lib/shell/InputStreamSink.java
+++ b/src/main/java/com/google/devtools/build/lib/shell/InputStreamSink.java
@@ -40,9 +40,8 @@
    */
   private static final byte[] DISCARD = new byte[4096];
 
-  // Supresses default constructor; ensures non-instantiability
-  private InputStreamSink() {
-  }
+  // Suppresses default constructor; ensures non-instantiability
+  private InputStreamSink() {}
 
   /**
    * A {@link Thread} which reads and discards data from an
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ChainUniquenessUtils.java b/src/main/java/com/google/devtools/build/lib/skyframe/ChainUniquenessUtils.java
index f0b3274..0ab6f96 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ChainUniquenessUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ChainUniquenessUtils.java
@@ -32,7 +32,7 @@
     int minPos = 0;
     String minString = cycle.get(0).toString();
     for (int i = 1; i < cycle.size(); i++) {
-      // TOOD(bazel-team): Is the toString representation stable enough?
+      // TODO(bazel-team): Is the toString representation stable enough?
       String candidateString = cycle.get(i).toString();
       if (candidateString.compareTo(minString) < 0) {
         minPos = i;
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunction.java
index 5312ca9..7294a24 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunction.java
@@ -75,7 +75,7 @@
     // root being the respective entry itself. These are all traversed for they may be
     // directories or symlinks to directories, and we need to establish Skyframe dependencies on
     // their contents for incremental correctness. If an entry is indeed a directory (but not when
-    // it's a symlink to one) then we have to create symlinks to each of their childen.
+    // it's a symlink to one) then we have to create symlinks to each of their children.
     // (NB: there seems to be no good reason for this, it's just how legacy Fileset works. We may
     // want to consider creating a symlink just for the directory and not for its child elements.)
     //
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageProgressReceiver.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageProgressReceiver.java
index 65214c8..5159449 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageProgressReceiver.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageProgressReceiver.java
@@ -19,9 +19,8 @@
 import java.util.LinkedHashSet;
 
 /**
- * A class that, when beeing told about start and end of a package
- * being loaded, keeps track of the loading progress and provides it
- * as a human-readable string intended for the progress bar.
+ * A class that, when being told about start and end of a package being loaded, keeps track of the
+ * loading progress and provides it as a human-readable string intended for the progress bar.
  */
 public class PackageProgressReceiver {
 
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/NullableListCodec.java b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/NullableListCodec.java
index bd3cf2c..87f71d8 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/NullableListCodec.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/NullableListCodec.java
@@ -27,7 +27,7 @@
 /**
  * Encodes a list of elements, each of which may be null. Unless explicitly specified as the codec,
  * lists will only use this codec if they extend {@link AbstractList} or are one of {@link
- * #RANDOM_ACCESS_TYPE} or {@link #SEQUENTIAL_ACCESS_TYPE} (intented to capture unmodifiable
+ * #RANDOM_ACCESS_TYPE} or {@link #SEQUENTIAL_ACCESS_TYPE} (intended to capture unmodifiable
  * versions of normal lists).
  */
 class NullableListCodec<T> implements ObjectCodec<List<T>> {
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/SingletonCodec.java b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/SingletonCodec.java
index 7175aad..952dcf0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/SingletonCodec.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/SingletonCodec.java
@@ -55,7 +55,7 @@
   @Override
   public void serialize(SerializationContext context, T t, CodedOutputStream codedOut)
       throws IOException {
-    // TODO(michajlo): See how usefuly mnemonic actually winds up being for debugging, we may
+    // TODO(michajlo): See how usefully mnemonic actually winds up being for debugging, we may
     // want to just toss it and trust that the classifier for this value is good enough.
     codedOut.writeByteArrayNoTag(mnemonic);
   }
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/ParamDescriptor.java b/src/main/java/com/google/devtools/build/lib/syntax/ParamDescriptor.java
index 3de6a15..de133db 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/ParamDescriptor.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/ParamDescriptor.java
@@ -39,7 +39,7 @@
   // The next two fields relate to toggling this parameter via semantic flag -- they will
   // be null if and only if this parameter is enabled, and will otherwise contain information
   // about what to do with the disabled parameter. (If the parameter is 'disabled', it will be
-  // treated as unusuable from Starlark.)
+  // treated as unusable from Starlark.)
 
   // The value of this disabled parameter (as interpreted in Starlark) will be passed to the Java
   // method.
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Printer.java b/src/main/java/com/google/devtools/build/lib/syntax/Printer.java
index ce34ea2..bcd144e 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Printer.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Printer.java
@@ -663,9 +663,8 @@
     }
   }
 
-
-  /** A printer that breaks lines beteen the entries of lists, with proper indenting. */
- public static class PrettyPrinter extends BasePrinter {
+  /** A printer that breaks lines between the entries of lists, with proper indenting. */
+  public static class PrettyPrinter extends BasePrinter {
     static final int BASE_INDENT = 4;
     private int indent;
 
diff --git a/src/main/java/com/google/devtools/build/lib/util/io/AsynchronousFileOutputStream.java b/src/main/java/com/google/devtools/build/lib/util/io/AsynchronousFileOutputStream.java
index 3cb1328..172750b 100644
--- a/src/main/java/com/google/devtools/build/lib/util/io/AsynchronousFileOutputStream.java
+++ b/src/main/java/com/google/devtools/build/lib/util/io/AsynchronousFileOutputStream.java
@@ -147,7 +147,7 @@
   }
 
   /**
-   * Closes the stream without waiting until pending writes are committed, and supressing errors.
+   * Closes the stream without waiting until pending writes are committed, and suppressing errors.
    *
    * <p>Pending writes will still continue asynchronously, but any errors will be ignored.
    */
diff --git a/src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java b/src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java
index 5eea55a..9112cbb 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java
@@ -46,8 +46,8 @@
  * may never have their data forcibly consolidated, since their reverse deps will only be retrieved
  * as a whole if they are marked dirty. Thus, we consolidate periodically.
  *
- * <p>{@link InMemoryNodeEntry} manages pending reverse dep operations on a marked-dirty or initally
- * evaluating node itself, using similar logic tuned to those cases, and calls into {@link
+ * <p>{@link InMemoryNodeEntry} manages pending reverse dep operations on a marked-dirty or
+ * initially evaluating node itself, using similar logic tuned to those cases, and calls into {@link
  * #consolidateDataAndReturnNewElements(InMemoryNodeEntry, OpToStoreBare)} when transitioning to
  * done.
  */
diff --git a/src/main/protobuf/builtin.proto b/src/main/protobuf/builtin.proto
index 03fa54e..af35215 100644
--- a/src/main/protobuf/builtin.proto
+++ b/src/main/protobuf/builtin.proto
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 //
-// Proto that exposes all BUILD and Skylark builtin symboles.
+// Proto that exposes all BUILD and Skylark builtin symbols.
 //
 // The API exporter is used for code completion in Cider.
 
diff --git a/src/main/protobuf/crosstool_config.proto b/src/main/protobuf/crosstool_config.proto
index 01fdb54..cf0b036 100644
--- a/src/main/protobuf/crosstool_config.proto
+++ b/src/main/protobuf/crosstool_config.proto
@@ -37,7 +37,7 @@
 // examples are 'x86_64-unknown-linux-gnu' and 'i686-unknown-cygwin'.
 //
 // The system name is used to determine if a given machine can execute a given
-// exectuable. In particular, it is used to check if the compilation products of
+// executable. In particular, it is used to check if the compilation products of
 // a toolchain can run on the host machine.
 message CToolchain {
 
diff --git a/src/test/cpp/rc_file_test.cc b/src/test/cpp/rc_file_test.cc
index 711e7b6..01a4d5a 100644
--- a/src/test/cpp/rc_file_test.cc
+++ b/src/test/cpp/rc_file_test.cc
@@ -764,7 +764,7 @@
         args, blaze_exit_code::SUCCESS, "",
         "WARNING: Duplicate rc file: .*myimportedbazelrc is read multiple "
         "times, "
-        "it is a standard rc file location but must have been unnecessarilly "
+        "it is a standard rc file location but must have been unnecessarily "
         "imported earlier.\n");
   }
 };
@@ -920,7 +920,7 @@
       args, blaze_exit_code::SUCCESS, "",
       "WARNING: Duplicate rc file: .*workspace.*bazelrc is read multiple "
       "times, it is a standard rc file location but must have been "
-      "unnecessarilly imported earlier.\n");
+      "unnecessarily imported earlier.\n");
 }
 #endif  // !defined(_WIN32) && !defined(__CYGWIN__)
 
diff --git a/src/test/java/com/google/devtools/build/android/desugar/DesugarLambdaTest.java b/src/test/java/com/google/devtools/build/android/desugar/DesugarLambdaTest.java
index 7c3d7ee..84cbecc 100644
--- a/src/test/java/com/google/devtools/build/android/desugar/DesugarLambdaTest.java
+++ b/src/test/java/com/google/devtools/build/android/desugar/DesugarLambdaTest.java
@@ -20,9 +20,7 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-/**
- * Tests uncommon lambda scenarious.
- */
+/** Tests uncommon lambda scenarios. */
 @RunWith(JUnit4.class)
 public class DesugarLambdaTest {
 
diff --git a/src/test/java/com/google/devtools/build/android/desugar/DesugarMainClassTest.java b/src/test/java/com/google/devtools/build/android/desugar/DesugarMainClassTest.java
index 0392012..a799550 100644
--- a/src/test/java/com/google/devtools/build/android/desugar/DesugarMainClassTest.java
+++ b/src/test/java/com/google/devtools/build/android/desugar/DesugarMainClassTest.java
@@ -61,7 +61,7 @@
    * LAMBDA_METAFACTORY_DUMPER_PROPERTY} in the command line.
    */
   private void testLambdaDumpDirPassSpecifiedInCmdPass() throws IOException {
-    // The following lambda ensures that the LambdaMetafactory is loaded at the beggining of this
+    // The following lambda ensures that the LambdaMetafactory is loaded at the beginning of this
     // test, so that the dump directory can be registered.
     Supplier<Path> supplier =
         () -> {
diff --git a/src/test/java/com/google/devtools/build/android/desugar/testdata/java8/Named.java b/src/test/java/com/google/devtools/build/android/desugar/testdata/java8/Named.java
index 4c44ffd..b50c338 100644
--- a/src/test/java/com/google/devtools/build/android/desugar/testdata/java8/Named.java
+++ b/src/test/java/com/google/devtools/build/android/desugar/testdata/java8/Named.java
@@ -32,7 +32,7 @@
     }
   }
 
-  /** Class whose base class implementes {@link #name}. */
+  /** Class whose base class implements {@link #name}. */
   public static class ExplicitName extends ExplicitNameBase implements Named {
     public ExplicitName(String name) {
       super(name);
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectCollectionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectCollectionTest.java
index a53a20d..8083c0a 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/AspectCollectionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectCollectionTest.java
@@ -415,10 +415,9 @@
     }
   }
 
-
   /**
-   * Creates an aspect wiht a class named {@code className} advertizing a provider
-   * {@code className} that requires any of providers {@code requiredAspects}.
+   * Creates an aspect with a class named {@code className} advertizing a provider {@code className}
+   * that requires any of providers {@code requiredAspects}.
    */
   private Aspect createAspect(final String className, String... requiredAspects) {
     ImmutableList.Builder<ImmutableSet<SkylarkProviderIdentifier>> requiredProvidersBuilder =
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/MockRuleCustomBehavior.java b/src/test/java/com/google/devtools/build/lib/analysis/util/MockRuleCustomBehavior.java
index 2d811dc..422f47a 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/MockRuleCustomBehavior.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/MockRuleCustomBehavior.java
@@ -18,7 +18,7 @@
 import com.google.devtools.build.lib.packages.RuleClass;
 
 /**
- * Interface for supporting arbitary custom behavior in mock rule classes.
+ * Interface for supporting arbitrary custom behavior in mock rule classes.
  *
  * <p>See {@link MockRule} for details and usage instructions.
  */
diff --git a/src/test/java/com/google/devtools/build/lib/concurrent/MoreFuturesTest.java b/src/test/java/com/google/devtools/build/lib/concurrent/MoreFuturesTest.java
index 227b9e7..89793ee 100644
--- a/src/test/java/com/google/devtools/build/lib/concurrent/MoreFuturesTest.java
+++ b/src/test/java/com/google/devtools/build/lib/concurrent/MoreFuturesTest.java
@@ -156,7 +156,7 @@
       }
     } finally {
       // The @After-annotated shutdownExecutor method blocks on completion of all tasks. Since we
-      // submitted a bunch of tasks that never complete, we need to explictly cancel them.
+      // submitted a bunch of tasks that never complete, we need to explicitly cancel them.
       for (DelayedFuture delayedFuture : futureList) {
         delayedFuture.cancel(/*mayInterruptIfRunning=*/ true);
       }
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
index ef62137..9d054f7 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
@@ -752,7 +752,7 @@
   public void testEarlyFlushBadInitialEvent() throws Exception {
     // Verify that an early flush works correctly with an unusual start event.
     // In this case, we expect 3 events in the stream, in that order:
-    // - an artifical progress event as initial event, to properly link in
+    // - an artificial progress event as initial event, to properly link in
     //   all events
     // - the unusal first event we have seen, and
     // - a progress event reporting the flushed messages.
diff --git a/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java b/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
index 32bf400..f5c533f 100644
--- a/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
@@ -239,7 +239,7 @@
       throws InterruptedException {
     // This is a regression test for a crash bug in
     // AbstractExceptionalParallelEvaluator#doMutatingEvaluation in a very specific window of time
-    // inbetween enqueueing one top-level node for evaluation and checking if another top-level node
+    // between enqueueing one top-level node for evaluation and checking if another top-level node
     // is done.
 
     // When we have two top-level nodes, A and B,
diff --git a/src/test/py/bazel/bazel_windows_cpp_test.py b/src/test/py/bazel/bazel_windows_cpp_test.py
index 108bd3b..ee20860 100644
--- a/src/test/py/bazel/bazel_windows_cpp_test.py
+++ b/src/test/py/bazel/bazel_windows_cpp_test.py
@@ -469,7 +469,7 @@
     ])
 
     # Test exporting symbols using custom DEF file in cc_library.
-    # Auto-generating DEF file should be disbaled when custom DEF file specified
+    # Auto-generating DEF file should be disabled when custom DEF file specified
     exit_code, _, stderr = self.RunBazel([
         'build', '//:lib', '-s', '--output_groups=dynamic_library',
         '--features=windows_export_all_symbols'
diff --git a/src/test/shell/bazel/bazel_embedded_skylark_test.sh b/src/test/shell/bazel/bazel_embedded_skylark_test.sh
index 56f34d9..1e0733b 100755
--- a/src/test/shell/bazel/bazel_embedded_skylark_test.sh
+++ b/src/test/shell/bazel/bazel_embedded_skylark_test.sh
@@ -48,7 +48,7 @@
 
 test_pkg_tar_quoting() {
   # Verify that pkg_tar can handle file names that are allowed as lablels
-  # but contain cahracters that could mess up options.
+  # but contain characters that could mess up options.
   rm -rf main out
   mkdir main
   cd main
diff --git a/src/test/shell/bazel/bazel_proto_library_test.sh b/src/test/shell/bazel/bazel_proto_library_test.sh
index 5475ba3..f286df7 100755
--- a/src/test/shell/bazel/bazel_proto_library_test.sh
+++ b/src/test/shell/bazel/bazel_proto_library_test.sh
@@ -214,7 +214,7 @@
   cat > proto_library/src/zip_code.proto <<EOF
 syntax = "proto3";
 
-package demo; // Requried to generate valid code.
+package demo; // Required to generate valid code.
 
 message ZipCode {
   string code = 1;
@@ -267,7 +267,7 @@
   cat > a/b/src/zip_code.proto <<EOF
 syntax = "proto3";
 
-package demo; // Requried to generate valid code.
+package demo; // Required to generate valid code.
 
 message ZipCode {
   string code = 1;
diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh
index 20c5bfb..1669928 100755
--- a/src/test/shell/bazel/bazel_rules_test.sh
+++ b/src/test/shell/bazel/bazel_rules_test.sh
@@ -307,7 +307,7 @@
     local -r EXPECTED_TMP="$new_tmpdir"
   fi
   assert_contains "PATH=$EXPECTED_PATH" bazel-genfiles/pkg/test.out
-  # Bazel respectes the client environment's TMPDIR.
+  # Bazel respects the client environment's TMPDIR.
   assert_contains "TMPDIR=${EXPECTED_TMP}$" bazel-genfiles/pkg/test.out
   if is_windows; then
     export TMP="${old_tmpdir}"
diff --git a/src/test/shell/bazel/bazel_toolchain_test.sh b/src/test/shell/bazel/bazel_toolchain_test.sh
index cb5a8bf..341b24c 100755
--- a/src/test/shell/bazel/bazel_toolchain_test.sh
+++ b/src/test/shell/bazel/bazel_toolchain_test.sh
@@ -33,7 +33,7 @@
 
 # Copy the project package here
 # We must use -L here; the files may be symlinks into the source tree, which we
-# could inadvertantly modify below.
+# could inadvertently modify below.
 cp -rL ${testdata_path}/bazel_toolchain_test_data/* .
 
 # Rename WORKSPACE.linaro file to WORKSPACE
diff --git a/src/test/shell/bazel/bazel_workspaces_test.sh b/src/test/shell/bazel/bazel_workspaces_test.sh
index efc1c6d..6293aa7 100755
--- a/src/test/shell/bazel/bazel_workspaces_test.sh
+++ b/src/test/shell/bazel/bazel_workspaces_test.sh
@@ -63,7 +63,7 @@
   num=`grep "${1}" output.log.txt | wc -l`
   if [ "$num" -ne $2 ]
   then
-    fail "Expected exactly $2 occurences of $1, got $num: " `cat output.log.txt`
+    fail "Expected exactly $2 occurrences of $1, got $num: " `cat output.log.txt`
   fi
 }
 
@@ -71,7 +71,7 @@
   num=`grep "${1}" output.log.txt | wc -l`
   if [ "$num" -lt $2 ]
   then
-    fail "Expected at least $2 occurences of $1, got $num: " `cat output.log.txt`
+    fail "Expected at least $2 occurrences of $1, got $num: " `cat output.log.txt`
   fi
 }
 
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index 7a48ae3d..03d29a8 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -1024,7 +1024,7 @@
 
 
 function test_inherit_build() {
-  # Verify that http_archive can use a BUILD file shiped with the
+  # Verify that http_archive can use a BUILD file shipped with the
   # external archive.
   mkdir ext
   cat > ext/BUILD <<'EOF'
@@ -1105,7 +1105,7 @@
   urls=["file://${EXTREPODIR}/ext.zip"],
 )
 EOF
-  bazel build '@ext//:bar' || fail "expected sucess"
+  bazel build '@ext//:bar' || fail "expected success"
 
   # Simulate going offline by removing the external archive
   rm -f "${EXTREPODIR}/ext.zip"
@@ -1159,7 +1159,7 @@
 EOF
   # Use the external repository once to make sure it is cached.
   bazel build --repository_cache="../cache" '@ext//:bar' \
-      || fail "expected sucess"
+      || fail "expected success"
 
   # Now "go offline" and clean local resources.
   rm -f "${WRKDIR}/ext.zip"
@@ -1174,7 +1174,7 @@
 
   # Clean again.
   bazel clean --expunge
-  # Even with a different source URL, the cache sould be consulted.
+  # Even with a different source URL, the cache should be consulted.
 
   cat > WORKSPACE <<EOF
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
@@ -1229,7 +1229,7 @@
 )
 EOF
   # Use the external repository once to make sure it is cached.
-  bazel build '@ext//:bar' || fail "expected sucess"
+  bazel build '@ext//:bar' || fail "expected success"
 
   # Now "go offline" and clean local resources.
   rm -f "${WRKDIR}/ext.zip"
@@ -1241,7 +1241,7 @@
 
   # Clean again.
   bazel clean --expunge
-  # Even with a different source URL, the cache sould be consulted.
+  # Even with a different source URL, the cache should be consulted.
 
   cat > WORKSPACE <<EOF
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
@@ -1287,7 +1287,7 @@
 )
 EOF
   # Use the external repository once to make sure it is cached.
-  bazel build '@ext//:foo' || fail "expected sucess"
+  bazel build '@ext//:foo' || fail "expected success"
 
   # Now "go offline" and clean local resources.
   rm -f "${TOPDIR}/ext.zip"
@@ -1328,11 +1328,11 @@
 )
 EOF
   # Use `--repository_cache` with no path to explicitly disable repository cache
-  bazel build --repository_cache= '@ext//:foo' || fail "expected sucess"
+  bazel build --repository_cache= '@ext//:foo' || fail "expected success"
 
   # make sure, the empty path is not interpreted relative to `pwd`; i.e., we do
   # not expect any new directories generated in the workspace, in particular
-  # none named conent_adressable, which is the directory where the cache puts
+  # none named conent_addressable, which is the directory where the cache puts
   # its artifacts into.
   ls -al | grep content_addressable \
       && fail "Should not interpret empty path as cache directly in the work space" || :
@@ -1388,7 +1388,7 @@
 EOF
   # Use the external repository once to make sure it is cached.
   bazel build --repository_cache="${TOPDIR}/cache}" '@ext//:bar' \
-      || fail "expected sucess"
+      || fail "expected success"
 
   # Now "go offline" and clean local resources.
   rm -f "${TOPDIR}/ext.zip"
@@ -1403,7 +1403,7 @@
 
   # Clean again.
   bazel clean --expunge
-  # Even with a different source URL, the cache sould be consulted.
+  # Even with a different source URL, the cache should be consulted.
 
   cat > WORKSPACE <<EOF
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
diff --git a/src/test/shell/bazel/external_patching_test.sh b/src/test/shell/bazel/external_patching_test.sh
index 702494d..6ddd024 100755
--- a/src/test/shell/bazel/external_patching_test.sh
+++ b/src/test/shell/bazel/external_patching_test.sh
@@ -264,7 +264,7 @@
 }
 
 test_override_buildfile() {
-  ## Verify that the BUILD file of an external repository can be overriden
+  ## Verify that the BUILD file of an external repository can be overridden
   ## via the http_archive rule.
   EXTREPODIR=`pwd`
   EXTREPOURL="$(get_extrepourl ${EXTREPODIR})"
@@ -322,7 +322,7 @@
 }
 
 test_override_buildfile_content() {
-  ## Verify that the BUILD file of an external repository can be overriden
+  ## Verify that the BUILD file of an external repository can be overridden
   ## via specified content in the http_archive rule.
   EXTREPODIR=`pwd`
   EXTREPOURL="$(get_extrepourl ${EXTREPODIR})"
@@ -379,7 +379,7 @@
 }
 
 test_override_buildfile_git() {
-  ## Verify that the BUILD file of an external repository can be overriden
+  ## Verify that the BUILD file of an external repository can be overridden
   ## via the git_repository rule.
   EXTREPODIR=`pwd`
   if is_windows; then
@@ -447,7 +447,7 @@
 }
 
 test_override_buildfilecontents_git() {
-  ## Verify that the BUILD file of an external repository can be overriden
+  ## Verify that the BUILD file of an external repository can be overridden
   ## via specified content in the git_repository rule.
   EXTREPODIR=`pwd`
   if is_windows; then
@@ -514,7 +514,7 @@
 }
 
 test_build_file_build_bazel() {
-  ## Verify that the BUILD file of an external repository can be overriden
+  ## Verify that the BUILD file of an external repository can be overridden
   ## via the http_archive rule.
   EXTREPODIR=`pwd`
   EXTREPOURL="$(get_extrepourl ${EXTREPODIR})"
diff --git a/src/test/shell/bazel/external_path_test.sh b/src/test/shell/bazel/external_path_test.sh
index 214ee34..3cf8592 100755
--- a/src/test/shell/bazel/external_path_test.sh
+++ b/src/test/shell/bazel/external_path_test.sh
@@ -86,7 +86,7 @@
 
 
 test_local_paths_main () {
-  # Verify that a target in the main repository may refer to a truely source
+  # Verify that a target in the main repository may refer to a truly source
   # file in its own repository by a path relative to the repository root.
   WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX")
   cd "${WRKDIR}"
@@ -101,7 +101,7 @@
 }
 
 test_local_paths_remote() {
-  # Verify that a target in an external repository may refer to a truely source
+  # Verify that a target in an external repository may refer to a truly source
   # file in its own repository by a path relative to the root of that repository
   WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX")
   cd "${WRKDIR}"
@@ -128,9 +128,9 @@
 }
 
 test_lib_paths_main() {
-  # Verify that libaries from the main repostiory can be used via include
+  # Verify that libaries from the main repository can be used via include
   # path relative to their repository root and that they may refer to other
-  # truely source files from the same libary via paths relative to their
+  # truly source files from the same library via paths relative to their
   # repository root.
 
   WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX")
@@ -165,7 +165,7 @@
 test_lib_paths_remote() {
   # Verify that libaries from an external repository can be used via include
   # path relative to their repository root and that they may refer to other
-  # truely source files from the same libary via paths relative to their
+  # truly source files from the same library via paths relative to their
   # repository root.
 
   WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX")
@@ -210,7 +210,7 @@
 test_lib_paths_all_remote() {
   # Verify that libaries from an external repository can be used by another
   # external repository via include path relative to their repository root and
-  # that they may refer to other truely source files from the same libary via
+  # that they may refer to other truly source files from the same library via
   # paths relative to their repository root.
 
   WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX")
@@ -263,7 +263,7 @@
 }
 
 repo_with_local_path_reference() {
-  # create, in the current working directory, a pacakge called
+  # create, in the current working directory, a package called
   # withpath, that contains rule depending on hard-code path relative
   # to the repository root.
   mkdir -p withpath
@@ -326,7 +326,7 @@
 repo_with_local_implicit_dependencies() {
   # create, in the current working directory, a package called rule
   # that has an implicit dependency on a target in the same repository;
-  # the point here is that this dependency can be named without knowlege
+  # the point here is that this dependency can be named without knowledge
   #  of the repository name.
   mkdir -p rule
   cat > rule/BUILD <<'EOF'
diff --git a/src/test/shell/bazel/workspace_resolved_test.sh b/src/test/shell/bazel/workspace_resolved_test.sh
index f1afbd7..dab3ebf 100755
--- a/src/test/shell/bazel/workspace_resolved_test.sh
+++ b/src/test/shell/bazel/workspace_resolved_test.sh
@@ -684,7 +684,7 @@
 }
 
 create_sample_repository() {
-  # Create, in the current direcotry, a repository that creates an external
+  # Create, in the current directory, a repository that creates an external
   # repository `foo` containing
   # - file with fixed data, generated by ctx.file,
   # - a BUILD file linked from the main repository
@@ -844,7 +844,7 @@
 
 test_usage_order_respected() {
    # Verify that if one rules uses a file from another (without any load
-   # statement inbetween), then still the resolved file is such that it can
+   # statement between), then still the resolved file is such that it can
    # be used as a workspace replacement.
    EXTREPODIR=`pwd`
    tar xvf ${TEST_SRCDIR}/jdk_WORKSPACE_files/archives.tar
diff --git a/src/test/shell/integration/action_env_test.sh b/src/test/shell/integration/action_env_test.sh
index f1fe4a5..2641607 100755
--- a/src/test/shell/integration/action_env_test.sh
+++ b/src/test/shell/integration/action_env_test.sh
@@ -207,7 +207,7 @@
     bazel test --test_output=all --action_env=FOO=foo //pkg:test_env_foo \
         || fail "expected to pass with correct value for FOO"
     # While the test is cached, changing the environment should rerun it and
-    # detect the failure in the new environemnt.
+    # detect the failure in the new environment.
     (bazel test --test_output=all --action_env=FOO=bar //pkg:test_env_foo \
          && fail "expected to fail with incorrect value for FOO") || true
     # Redo the same FOO being taken from the environment
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index badd0f6..9375f38 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -232,7 +232,7 @@
 
 function test_basic() {
   # Basic properties of the event stream
-  # - a completed target explicity requested should be reported
+  # - a completed target explicitly requested should be reported
   # - after success the stream should close naturally, without any
   #   reports about aborted events
   # - the command line is reported in structured and unstructured form
diff --git a/src/test/shell/integration/spend_cpu_time.cc b/src/test/shell/integration/spend_cpu_time.cc
index 55b8fe9..c6eae0a 100644
--- a/src/test/shell/integration/spend_cpu_time.cc
+++ b/src/test/shell/integration/spend_cpu_time.cc
@@ -104,7 +104,7 @@
   return my_rusage.ru_stime.tv_sec * 1000 + my_rusage.ru_stime.tv_usec / 1000;
 }
 
-// Substracts subtrahend from minuend, or returns zero if the subtrahend is
+// Subtracts subtrahend from minuend, or returns zero if the subtrahend is
 // larger than the minuend.
 static uint64_t SubtractOrZero(const uint64_t minuend,
                                const uint64_t subtrahend) {
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index 38ee3a6..4542ce4 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -64,7 +64,7 @@
 PATH_TO_BAZEL_WRAPPER="$(dirname $(rlocation io_bazel/src/test/shell/bin/bazel))"
 # Convert PATH_TO_BAZEL_WRAPPER to Unix path style on Windows, because it will be
 # added into PATH. There's problem if PATH=C:/msys64/usr/bin:/usr/local,
-# because ':' is used as both path seperator and in C:/msys64/...
+# because ':' is used as both path separator and in C:/msys64/...
 if is_windows; then
   PATH_TO_BAZEL_WRAPPER="$(cygpath -u "$PATH_TO_BAZEL_WRAPPER")"
 fi
@@ -221,7 +221,7 @@
 }
 
 #
-# A uniform SHA-256 commands that works accross platform
+# A uniform SHA-256 commands that works across platform
 #
 case "${PLATFORM}" in
   darwin|freebsd)
diff --git a/src/tools/android/java/com/google/devtools/build/android/Aapt2ResourceShrinkingAction.java b/src/tools/android/java/com/google/devtools/build/android/Aapt2ResourceShrinkingAction.java
index 1d97811..3344c0d 100644
--- a/src/tools/android/java/com/google/devtools/build/android/Aapt2ResourceShrinkingAction.java
+++ b/src/tools/android/java/com/google/devtools/build/android/Aapt2ResourceShrinkingAction.java
@@ -84,7 +84,7 @@
             .writeReportTo(options.log)
             .writeResourcesToZip(options.shrunkResources);
         if (options.rTxtOutput != null) {
-          // Fufill the contract -- however, we do not generate an R.txt from the shrunk
+          // Fulfill the contract -- however, we do not generate an R.txt from the shrunk
           // resources.
           Files.copy(options.rTxt, options.rTxtOutput);
         }
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidDataBindingProcessingAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidDataBindingProcessingAction.java
index e8bbdc6..b2b470b 100644
--- a/src/tools/android/java/com/google/devtools/build/android/AndroidDataBindingProcessingAction.java
+++ b/src/tools/android/java/com/google/devtools/build/android/AndroidDataBindingProcessingAction.java
@@ -74,7 +74,7 @@
         effectTags = {OptionEffectTag.UNKNOWN},
         help =
             "Variant configuration type for packaging the resources."
-                + " Acceptible values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST")
+                + " Acceptable values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST")
     public VariantType packageType;
 
     @Option(
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java
index 2eade05..58302ec 100644
--- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java
+++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java
@@ -264,7 +264,7 @@
         effectTags = {OptionEffectTag.UNKNOWN},
         help =
             "Variant configuration type for packaging the resources."
-                + " Acceptible values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST")
+                + " Acceptable values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST")
     public VariantType packageType;
 
     @Option(
diff --git a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java
index 81bfb73..441e9fe 100644
--- a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java
+++ b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java
@@ -197,16 +197,15 @@
     public Path log;
 
     @Option(
-      name = "packageType",
-      defaultValue = "DEFAULT",
-      converter = VariantTypeConverter.class,
-      category = "config",
-      documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
-      effectTags = {OptionEffectTag.UNKNOWN},
-      help =
-          "Variant configuration type for packaging the resources."
-              + " Acceptible values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST"
-    )
+        name = "packageType",
+        defaultValue = "DEFAULT",
+        converter = VariantTypeConverter.class,
+        category = "config",
+        documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+        effectTags = {OptionEffectTag.UNKNOWN},
+        help =
+            "Variant configuration type for packaging the resources."
+                + " Acceptable values DEFAULT, LIBRARY, ANDROID_TEST, UNIT_TEST")
     public VariantType packageType;
   }
 
diff --git a/src/tools/android/java/com/google/devtools/build/android/aapt2/ResourceLinker.java b/src/tools/android/java/com/google/devtools/build/android/aapt2/ResourceLinker.java
index 8837a51..7b9c3f8 100644
--- a/src/tools/android/java/com/google/devtools/build/android/aapt2/ResourceLinker.java
+++ b/src/tools/android/java/com/google/devtools/build/android/aapt2/ResourceLinker.java
@@ -428,7 +428,7 @@
 
   private Path combineApks(Path protoApk, Path binaryApk, Path workingDirectory)
       throws IOException {
-    // Linking against apk as a static library elides assets, amoung other things.
+    // Linking against apk as a static library elides assets, among other things.
     // So, copy the missing details to the new apk.
     profiler.startTask("combine");
     final Path combined = workingDirectory.resolve("combined.apk");
diff --git a/src/tools/android/java/com/google/devtools/build/android/desugar/runtime/ThrowableExtension.java b/src/tools/android/java/com/google/devtools/build/android/desugar/runtime/ThrowableExtension.java
index 070363a..1886874 100644
--- a/src/tools/android/java/com/google/devtools/build/android/desugar/runtime/ThrowableExtension.java
+++ b/src/tools/android/java/com/google/devtools/build/android/desugar/runtime/ThrowableExtension.java
@@ -65,7 +65,7 @@
       // This catchall block is intentionally created to avoid anything unexpected, so that
       // the desugared app will continue running in case of exceptions.
       System.err.println(
-          "An error has occured when initializing the try-with-resources desuguring strategy. "
+          "An error has occurred when initializing the try-with-resources desuguring strategy. "
               + "The default strategy "
               + NullDesugaringStrategy.class.getName()
               + "will be used. The error is: ");
diff --git a/src/tools/android/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java b/src/tools/android/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java
index 1cd9b84..ab0b838 100644
--- a/src/tools/android/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java
+++ b/src/tools/android/java/com/google/devtools/build/android/dexer/ZipEntryComparator.java
@@ -34,8 +34,8 @@
   }
 
   /**
-   * Sorts java class names such that outer classes preceed their inner
-   * classes and "package-info" preceeds all other classes in its package.
+   * Sorts java class names such that outer classes precede their inner classes and "package-info"
+   * precedes all other classes in its package.
    *
    * @param a {@code non-null;} first class name
    * @param b {@code non-null;} second class name
diff --git a/src/tools/launcher/java_launcher.cc b/src/tools/launcher/java_launcher.cc
index 6be0411..c7915e0 100644
--- a/src/tools/launcher/java_launcher.cc
+++ b/src/tools/launcher/java_launcher.cc
@@ -103,7 +103,7 @@
   vector<wstring> args;
   bool first = 1;
   for (const auto& arg : this->GetCommandlineArguments()) {
-    // Skip the first arugment.
+    // Skip the first argument.
     if (first) {
       first = 0;
       continue;
@@ -403,7 +403,7 @@
   }
   // Add java start class
   arguments.push_back(this->GetLaunchInfoByKey(JAVA_START_CLASS));
-  // Add the remaininng arguements, they will be passed to the program.
+  // Add the remaininng arguments, they will be passed to the program.
   for (const auto& arg : remaining_args) {
     arguments.push_back(arg);
   }
diff --git a/src/tools/launcher/launcher.h b/src/tools/launcher/launcher.h
index 838dc47d..911e8a0 100644
--- a/src/tools/launcher/launcher.h
+++ b/src/tools/launcher/launcher.h
@@ -67,9 +67,9 @@
   // If --print_launcher_command exists in arguments, then we print the full
   // command line instead of launching the real process.
   //
-  // exectuable: the binary to be executed.
-  // arguments:  the command line arguments to be passed to the exectuable,
-  //             it doesn't include the exectuable itself.
+  // executable: the binary to be executed.
+  // arguments:  the command line arguments to be passed to the executable,
+  //             it doesn't include the executable itself.
   //             The arguments are expected to be quoted if having spaces.
   ExitCode LaunchProcess(const std::wstring& executable,
                          const std::vector<std::wstring>& arguments,
@@ -94,7 +94,7 @@
   // Path to the runfiles directory, if one exists.
   const std::wstring runfiles_dir;
 
-  // The commandline arguments recieved.
+  // The commandline arguments received.
   // The first argument is the path of this launcher itself.
   std::vector<std::wstring> commandline_arguments;
 
@@ -117,9 +117,9 @@
 
   // Create a command line to be passed to Windows CreateProcessA API.
   //
-  // exectuable: the binary to be executed.
-  // arguments:  the command line arguments to be passed to the exectuable,
-  //             it doesn't include the exectuable itself.
+  // executable: the binary to be executed.
+  // arguments:  the command line arguments to be passed to the executable,
+  //             it doesn't include the executable itself.
   void CreateCommandLine(CmdLine* result, const std::wstring& executable,
                          const std::vector<std::wstring>& arguments) const;
 
diff --git a/src/tools/launcher/util/launcher_util.h b/src/tools/launcher/util/launcher_util.h
index deb4065..7cd0cf2 100644
--- a/src/tools/launcher/util/launcher_util.h
+++ b/src/tools/launcher/util/launcher_util.h
@@ -36,7 +36,7 @@
 // On Windows, if the binary path is foo/bar/bin.exe then return foo/bar/bin
 std::wstring GetBinaryPathWithoutExtension(const std::wstring& binary);
 
-// Add exectuable extension to binary path
+// Add executable extension to binary path
 //
 // On Windows, if the binary path is foo/bar/bin then return foo/bar/bin.exe
 std::wstring GetBinaryPathWithExtension(const std::wstring& binary);
diff --git a/src/tools/xcode/stdredirect/run_tests.sh b/src/tools/xcode/stdredirect/run_tests.sh
index 0cb5aab..2c5f492 100755
--- a/src/tools/xcode/stdredirect/run_tests.sh
+++ b/src/tools/xcode/stdredirect/run_tests.sh
@@ -37,7 +37,7 @@
 # It's the only way I know of to launch the simulator safely using xcrun.
 # This will launch the simulator with a given device. If the simulator is already running
 # it will switch to the given device.
-# Radar 21392428 xcrun should allow me to specifiy "iOS Simulator" in some manner
+# Radar 21392428 xcrun should allow me to specify "iOS Simulator" in some manner
 xcrun instruments -w $TEST_DEVICE_ID &>/dev/null || true
 
 xcrun simctl install $TEST_DEVICE_ID $1