diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc53cdfe7a..7d86e26e37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,6 @@ repos: - id: typos exclude: | (?x)^( - cargo| crate_universe| examples| extensions| diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000000..a8a1fde16f --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +nto = "nto" # For toolchains diff --git a/cargo/private/cargo_bootstrap.bzl b/cargo/private/cargo_bootstrap.bzl index a8021c49d6..789f299bbd 100644 --- a/cargo/private/cargo_bootstrap.bzl +++ b/cargo/private/cargo_bootstrap.bzl @@ -142,7 +142,7 @@ rust_binary( """ def _collect_environ(repository_ctx, host_triple): - """Gather environment varialbes to use from the current rule context + """Gather environment variables to use from the current rule context Args: repository_ctx (repository_ctx): The rule's context object. @@ -169,7 +169,7 @@ def _detect_changes(repository_ctx): Args: repository_ctx (repository_ctx): The rule's context object. """ - # Simply generating a `path` object consideres the file as 'tracked' or + # Simply generating a `path` object considered the file as 'tracked' or # 'consumed' which means changes to it will trigger rebuilds for src in repository_ctx.attr.srcs: @@ -229,7 +229,7 @@ def _cargo_bootstrap_repository_impl(repository_ctx): timeout = repository_ctx.attr.timeout, ) - # Create a symlink so that the binary can be accesed via it's target name + # Create a symlink so that the binary can be accessed via it's target name repository_ctx.symlink(built_binary, binary_name) repository_ctx.file("BUILD.bazel", _BUILD_FILE_CONTENT.format( @@ -267,7 +267,7 @@ cargo_bootstrap_repository = repository_rule( mandatory = True, ), "compressed_windows_toolchain_names": attr.bool( - doc = "Wether or not the toolchain names of windows toolchains are expected to be in a `compressed` format.", + doc = "Whether or not the toolchain names of windows toolchains are expected to be in a `compressed` format.", default = True, ), "env": attr.string_dict( @@ -303,7 +303,7 @@ cargo_bootstrap_repository = repository_rule( default = "@rust_{system}_{arch}__{triple}__{channel}_tools//:bin/{tool}", ), "srcs": attr.label_list( - doc = "Souce files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made", + doc = "Source files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made", allow_files = True, ), "timeout": attr.int( diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_script.bzl index 06dc0a3d97..ceb38987e7 100644 --- a/cargo/private/cargo_build_script.bzl +++ b/cargo/private/cargo_build_script.bzl @@ -62,7 +62,7 @@ def _cargo_build_script_runfiles_impl(ctx): is_executable = True, ) - # Tools are ommitted here because they should be within the `script` + # Tools are omitted here because they should be within the `script` # attribute's runfiles. runfiles = ctx.runfiles(files = ctx.files.data) @@ -83,7 +83,7 @@ cargo_build_script_runfiles = rule( A rule for producing `cargo_build_script.script` with proper runfiles. This rule ensure's the executable for `cargo_build_script` has properly formed runfiles with `cfg=target` and -`cfg=exec` files. This is a challenge becuase had the script binary been directly consumed, it would have been +`cfg=exec` files. This is a challenge because had the script binary been directly consumed, it would have been in either configuration which would have been incorrect for either the `tools` (exec) or `data` (target) attributes. This is solved here by consuming the script as exec and creating a symlink to consumers of this rule can consume with `cfg=target` and still get an exec compatible binary. diff --git a/cargo/private/cargo_build_script_wrapper.bzl b/cargo/private/cargo_build_script_wrapper.bzl index 54446c0d85..ffa0ebcdce 100644 --- a/cargo/private/cargo_build_script_wrapper.bzl +++ b/cargo/private/cargo_build_script_wrapper.bzl @@ -100,7 +100,7 @@ def cargo_build_script( edition (str): The rust edition to use for the internal binary crate. crate_name (str): Crate name to use for build script. crate_root (label): The file that will be passed to rustc to be used for building this crate. - srcs (list of label): Souce files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made. + srcs (list of label): Source files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made. crate_features (list, optional): A list of features to enable for the build script. version (str, optional): The semantic version (semver) of the crate. deps (list, optional): The build-dependencies of the crate. @@ -130,7 +130,7 @@ def cargo_build_script( These are other `rust_library` targets and will be presented as the new name given. **kwargs: Forwards to the underlying `rust_binary` rule. An exception is the `compatible_with` attribute, which shouldn't be forwarded to the `rust_binary`, as the `rust_binary` is only - built and used in `exec` mode. We propagate the `compatible_with` attribute to the `_build_scirpt_run` + built and used in `exec` mode. We propagate the `compatible_with` attribute to the `_build_script_run` target. """ diff --git a/cargo/private/cargo_dep_env.bzl b/cargo/private/cargo_dep_env.bzl index 1075ee982f..2fd0ab6bf4 100644 --- a/cargo/private/cargo_dep_env.bzl +++ b/cargo/private/cargo_dep_env.bzl @@ -43,7 +43,7 @@ def _cargo_dep_env_impl(ctx): # (cargo_build_script and otherwise), alongside the DepInfo. This is how other rules # identify this one as a valid dependency, but we don't otherwise have a use for it. # - # TLDR: This BuildInfo propagates up normal (non build script) depenencies. + # TLDR: This BuildInfo propagates up normal (non build script) dependencies. # # In the future, we could consider setting rustc_env here, and also propagating dep_dir # so files in it can be referenced there. diff --git a/cargo/private/cargo_toml_info/main.rs b/cargo/private/cargo_toml_info/main.rs index 1efcbc598c..f663ef696c 100644 --- a/cargo/private/cargo_toml_info/main.rs +++ b/cargo/private/cargo_toml_info/main.rs @@ -127,7 +127,7 @@ fn format_lint_set<'a>( Some(formatted) } -/// Generates space seperated files that get read back in by Bazel. +/// Generates space separated files that get read back in by Bazel. fn generate_lints_info( crate_manifest: &Manifest, workspace_manifest: Option<&Manifest>, diff --git a/cargo/settings/settings.bzl b/cargo/settings/settings.bzl index c0bbf6180e..adfcf6bf21 100644 --- a/cargo/settings/settings.bzl +++ b/cargo/settings/settings.bzl @@ -15,7 +15,7 @@ def experimental_symlink_execroot(): ) def incompatible_runfiles_cargo_manifest_dir(): - """A flag which causes `cargo_build_script` to write an explicit `CARGO_MANFIEST_DIR` \ + """A flag which causes `cargo_build_script` to write an explicit `CARGO_MANIFEST_DIR` \ directory from an action instead of using runfiles directories which cannot be \ passed to downstream actions.