Skip to content

Commit 62d7317

Browse files
authored
Fix typos in cargo folder (#3488)
Followup of #3484 fixing typos in cargo folder
1 parent daae900 commit 62d7317

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repos:
1010
- id: typos
1111
exclude: |
1212
(?x)^(
13-
cargo|
1413
crate_universe|
1514
examples|
1615
extensions|

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
nto = "nto" # For toolchains

cargo/private/cargo_bootstrap.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ rust_binary(
142142
"""
143143

144144
def _collect_environ(repository_ctx, host_triple):
145-
"""Gather environment varialbes to use from the current rule context
145+
"""Gather environment variables to use from the current rule context
146146
147147
Args:
148148
repository_ctx (repository_ctx): The rule's context object.
@@ -169,7 +169,7 @@ def _detect_changes(repository_ctx):
169169
Args:
170170
repository_ctx (repository_ctx): The rule's context object.
171171
"""
172-
# Simply generating a `path` object consideres the file as 'tracked' or
172+
# Simply generating a `path` object considered the file as 'tracked' or
173173
# 'consumed' which means changes to it will trigger rebuilds
174174

175175
for src in repository_ctx.attr.srcs:
@@ -229,7 +229,7 @@ def _cargo_bootstrap_repository_impl(repository_ctx):
229229
timeout = repository_ctx.attr.timeout,
230230
)
231231

232-
# Create a symlink so that the binary can be accesed via it's target name
232+
# Create a symlink so that the binary can be accessed via it's target name
233233
repository_ctx.symlink(built_binary, binary_name)
234234

235235
repository_ctx.file("BUILD.bazel", _BUILD_FILE_CONTENT.format(
@@ -267,7 +267,7 @@ cargo_bootstrap_repository = repository_rule(
267267
mandatory = True,
268268
),
269269
"compressed_windows_toolchain_names": attr.bool(
270-
doc = "Wether or not the toolchain names of windows toolchains are expected to be in a `compressed` format.",
270+
doc = "Whether or not the toolchain names of windows toolchains are expected to be in a `compressed` format.",
271271
default = True,
272272
),
273273
"env": attr.string_dict(
@@ -303,7 +303,7 @@ cargo_bootstrap_repository = repository_rule(
303303
default = "@rust_{system}_{arch}__{triple}__{channel}_tools//:bin/{tool}",
304304
),
305305
"srcs": attr.label_list(
306-
doc = "Souce files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made",
306+
doc = "Source files of the crate to build. Passing source files here can be used to trigger rebuilds when changes are made",
307307
allow_files = True,
308308
),
309309
"timeout": attr.int(

cargo/private/cargo_build_script.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _cargo_build_script_runfiles_impl(ctx):
6262
is_executable = True,
6363
)
6464

65-
# Tools are ommitted here because they should be within the `script`
65+
# Tools are omitted here because they should be within the `script`
6666
# attribute's runfiles.
6767
runfiles = ctx.runfiles(files = ctx.files.data)
6868

@@ -83,7 +83,7 @@ cargo_build_script_runfiles = rule(
8383
A rule for producing `cargo_build_script.script` with proper runfiles.
8484
8585
This rule ensure's the executable for `cargo_build_script` has properly formed runfiles with `cfg=target` and
86-
`cfg=exec` files. This is a challenge becuase had the script binary been directly consumed, it would have been
86+
`cfg=exec` files. This is a challenge because had the script binary been directly consumed, it would have been
8787
in either configuration which would have been incorrect for either the `tools` (exec) or `data` (target) attributes.
8888
This is solved here by consuming the script as exec and creating a symlink to consumers of this rule can consume
8989
with `cfg=target` and still get an exec compatible binary.

cargo/private/cargo_build_script_wrapper.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def cargo_build_script(
100100
edition (str): The rust edition to use for the internal binary crate.
101101
crate_name (str): Crate name to use for build script.
102102
crate_root (label): The file that will be passed to rustc to be used for building this crate.
103-
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.
103+
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.
104104
crate_features (list, optional): A list of features to enable for the build script.
105105
version (str, optional): The semantic version (semver) of the crate.
106106
deps (list, optional): The build-dependencies of the crate.
@@ -130,7 +130,7 @@ def cargo_build_script(
130130
These are other `rust_library` targets and will be presented as the new name given.
131131
**kwargs: Forwards to the underlying `rust_binary` rule. An exception is the `compatible_with`
132132
attribute, which shouldn't be forwarded to the `rust_binary`, as the `rust_binary` is only
133-
built and used in `exec` mode. We propagate the `compatible_with` attribute to the `_build_scirpt_run`
133+
built and used in `exec` mode. We propagate the `compatible_with` attribute to the `_build_script_run`
134134
target.
135135
"""
136136

cargo/private/cargo_dep_env.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _cargo_dep_env_impl(ctx):
4343
# (cargo_build_script and otherwise), alongside the DepInfo. This is how other rules
4444
# identify this one as a valid dependency, but we don't otherwise have a use for it.
4545
#
46-
# TLDR: This BuildInfo propagates up normal (non build script) depenencies.
46+
# TLDR: This BuildInfo propagates up normal (non build script) dependencies.
4747
#
4848
# In the future, we could consider setting rustc_env here, and also propagating dep_dir
4949
# so files in it can be referenced there.

cargo/private/cargo_toml_info/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn format_lint_set<'a>(
127127
Some(formatted)
128128
}
129129

130-
/// Generates space seperated <lint name> <lint level> files that get read back in by Bazel.
130+
/// Generates space separated <lint name> <lint level> files that get read back in by Bazel.
131131
fn generate_lints_info(
132132
crate_manifest: &Manifest,
133133
workspace_manifest: Option<&Manifest>,

cargo/settings/settings.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def experimental_symlink_execroot():
1515
)
1616

1717
def incompatible_runfiles_cargo_manifest_dir():
18-
"""A flag which causes `cargo_build_script` to write an explicit `CARGO_MANFIEST_DIR` \
18+
"""A flag which causes `cargo_build_script` to write an explicit `CARGO_MANIFEST_DIR` \
1919
directory from an action instead of using runfiles directories which cannot be \
2020
passed to downstream actions.
2121

0 commit comments

Comments
 (0)