Skip to content

Fix typos in cargo folder #3488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repos:
- id: typos
exclude: |
(?x)^(
cargo|
crate_universe|
examples|
extensions|
Expand Down
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default.extend-words]
nto = "nto" # For toolchains
10 changes: 5 additions & 5 deletions cargo/private/cargo_bootstrap.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions cargo/private/cargo_build_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cargo/private/cargo_build_script_wrapper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
"""

Expand Down
2 changes: 1 addition & 1 deletion cargo/private/cargo_dep_env.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cargo/private/cargo_toml_info/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn format_lint_set<'a>(
Some(formatted)
}

/// Generates space seperated <lint name> <lint level> files that get read back in by Bazel.
/// Generates space separated <lint name> <lint level> files that get read back in by Bazel.
fn generate_lints_info(
crate_manifest: &Manifest,
workspace_manifest: Option<&Manifest>,
Expand Down
2 changes: 1 addition & 1 deletion cargo/settings/settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down