diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000..95fc51b97 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,13 @@ +name: Typos +on: [pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4.1.7 + + - name: Check spelling + uses: crate-ci/typos@v1.22.9 diff --git a/docs/build_options.md b/docs/build_options.md index c56de4c1b..ef0ffce78 100644 --- a/docs/build_options.md +++ b/docs/build_options.md @@ -58,7 +58,7 @@ For example: in any directory - `foo/` matches all files under the `foo` directory -The globs are always evaluted relative to the prefix directory. If you have no +The globs are always evaluated relative to the prefix directory. If you have no `include` globs, but an `exclude` glob, then all files are included except those that match the `exclude` glob. This is equivalent to `include: ['**']`. @@ -136,7 +136,7 @@ build: # ignore all or specific files for prefix replacement` ignore: bool | [path] (defaults to false) - # wether to detect binary files with prefix or not + # whether to detect binary files with prefix or not # defaults to true on Unix and (always) false on Windows ignore_binary_files: bool ``` @@ -228,7 +228,7 @@ build: # outside of the environment rpath_allowlist: list of globs - # wether to relocate binaries or not. If this is a list of paths, then + # whether to relocate binaries or not. If this is a list of paths, then # only the listed paths are relocated binary_relocation: bool (defaults to true) | list of globs diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 55b2ca516..cec4f4528 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -632,7 +632,7 @@ Generate a recipe for an R package from CRAN - `-t`, `--tree` - Wether to create recipes for the whole dependency tree or not + Whether to create recipes for the whole dependency tree or not - Possible values: `true`, `false` diff --git a/docs/reference/recipe_file.md b/docs/reference/recipe_file.md index c4e095ea0..64c4284ad 100644 --- a/docs/reference/recipe_file.md +++ b/docs/reference/recipe_file.md @@ -218,7 +218,7 @@ source: tag: "1.1.4" ``` -Futhermore, if you want to fetch just the current "`HEAD`" (this may result in +Furthermore, if you want to fetch just the current "`HEAD`" (this may result in non-deterministic builds), then you can use `depth`. ```yaml diff --git a/docs/testing.md b/docs/testing.md index 5f04f1eca..b4016b061 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -70,7 +70,7 @@ For a script test: For a Python import test: - A JSON file is created that is called `python_test.json` and stores the - imports to be tested and wether to execute `pip check` or not. This file is + imports to be tested and whether to execute `pip check` or not. This file is placed under `info/tests/{index}/` For a downstream test: diff --git a/docs/tutorials/cpp.md b/docs/tutorials/cpp.md index aaa5708d7..123e2da87 100644 --- a/docs/tutorials/cpp.md +++ b/docs/tutorials/cpp.md @@ -101,10 +101,10 @@ But which the package doesn't depend on itself. 5. The `files` section specifies the files to be tested for existence, using a glob pattern. !!! note "`CMAKE_ARGS`" - It can be tedious to remember all the diffent variables one needs to pass to CMake to create the perfect build. + It can be tedious to remember all the different variables one needs to pass to CMake to create the perfect build. The `cmake` package on conda-forge introduces the`CMAKE_ARGS` environment variable. This variable contains the necessary flags to make the package build correctly, also when cross-compiling from one machine to another. - Therefore, it is often not necesary to pass any additional flags to the `cmake` command. + Therefore, it is often not necessary to pass any additional flags to the `cmake` command. However, because this is a tutorial we will show how to pass the necessary flags to `cmake` manually. For more information please refer to the [conda-forge documentation](https://conda-forge.org/docs/maintainer/knowledge_base/#how-to-enable-cross-compilation). diff --git a/src/cache.rs b/src/cache.rs index 5881bdc0a..e8b35dba8 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -74,7 +74,7 @@ impl Output { } } // always insert the target platform and build platform - // we are using the `host_platform` here because for the cache it should not matter wether it's being + // we are using the `host_platform` here because for the cache it should not matter whether it's being // build for `noarch` or not (one can have mixed outputs, in fact). selected_variant.insert("host_platform", self.host_platform().to_string()); selected_variant.insert( diff --git a/src/linux/link.rs b/src/linux/link.rs index e23c2fc62..5c74dd54f 100644 --- a/src/linux/link.rs +++ b/src/linux/link.rs @@ -235,7 +235,7 @@ fn call_patchelf( let mut cmd = system_tools.call(Tool::Patchelf)?; // prefer using RPATH over RUNPATH because RPATH takes precedence when - // searching for shared libraries and cannot be overriden with + // searching for shared libraries and cannot be overridden with // `LD_LIBRARY_PATH`. This ensures that the libraries from the environment // are found first, providing better isolation and preventing potential // conflicts with system libraries. diff --git a/src/metadata.rs b/src/metadata.rs index 59b5a287c..34de4c960 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -199,7 +199,7 @@ impl Directories { } } -/// Default value for store recipe for backwards compatiblity +/// Default value for store recipe for backwards compatibility fn default_true() -> bool { true } @@ -259,7 +259,7 @@ pub struct BuildConfiguration { /// Whether to store the recipe and build instructions in the final package or not #[serde(skip_serializing, default = "default_true")] pub store_recipe: bool, - /// Wether to set additional environment variables to force colors in the build script or not + /// Whether to set additional environment variables to force colors in the build script or not #[serde(skip_serializing, default = "default_true")] pub force_colors: bool, } diff --git a/src/package_test/content_test.rs b/src/package_test/content_test.rs index ac5bbe324..2e6802c2b 100644 --- a/src/package_test/content_test.rs +++ b/src/package_test/content_test.rs @@ -179,9 +179,9 @@ impl PackageContentsTest { if site_package.glob().contains('/') { globset.add(build_glob(format!("{site_packages_base}/{site_package}"))?); } else { - let mut splitted = site_package.glob().split('.').collect::>(); - let last_elem = splitted.pop().unwrap_or_default(); - let mut site_package_path = splitted.join("/"); + let mut split = site_package.glob().split('.').collect::>(); + let last_elem = split.pop().unwrap_or_default(); + let mut site_package_path = split.join("/"); if !site_package_path.is_empty() { site_package_path.push('/'); } diff --git a/src/recipe/custom_yaml.rs b/src/recipe/custom_yaml.rs index 25166341a..53dec6968 100644 --- a/src/recipe/custom_yaml.rs +++ b/src/recipe/custom_yaml.rs @@ -27,7 +27,7 @@ use super::Render; /// This is a reinterpretation of the [`marked_yaml::Node`] type that is specific /// for the first stage of the new Conda recipe format parser. This type handles /// the `if / then / else` selector (or if-selector for simplicity) as a special -/// case of the sequence node, i.e., the occurences of if-selector in the recipe +/// case of the sequence node, i.e., the occurrences of if-selector in the recipe /// are syntactically parsed in the conversion of [`marked_yaml::Node`] to this type. /// /// **CAUTION:** The user of this type that is responsible to handle the if the @@ -626,7 +626,7 @@ impl fmt::Debug for SequenceNode { /// Mapping nodes in YAML are defined as a key/value mapping where the keys are /// unique and always scalars, whereas values may be YAML nodes of any kind. /// -/// Because ther is an example that on the `context` key-value definition, a later +/// Because there is an example that on the `context` key-value definition, a later /// key was defined as a jinja string using previous values, we need to care about /// insertion order we use [`IndexMap`] for this. /// diff --git a/src/recipe/custom_yaml/rendered.rs b/src/recipe/custom_yaml/rendered.rs index 542491707..404aeeee6 100644 --- a/src/recipe/custom_yaml/rendered.rs +++ b/src/recipe/custom_yaml/rendered.rs @@ -25,7 +25,7 @@ use super::{ /// This is a reinterpretation of the [`marked_yaml::Node`] type that is specific /// for the first stage of the new Conda recipe format parser. This type handles /// the `if / then / else` selector (or if-selector for simplicity) as a special -/// case of the sequence node, i.e., the occurences of if-selector in the recipe +/// case of the sequence node, i.e., the occurrences of if-selector in the recipe /// are syntactically parsed in the conversion of [`marked_yaml::Node`] to this type. /// /// **CAUTION:** The user of this type that is responsible to handle the if the @@ -474,7 +474,7 @@ impl fmt::Debug for RenderedSequenceNode { /// Mapping nodes in YAML are defined as a key/value mapping where the keys are /// unique and always scalars, whereas values may be YAML nodes of any kind. /// -/// Because ther is an example that on the `context` key-value definition, a later +/// Because there is an example that on the `context` key-value definition, a later /// key was defined as a jinja string using previous values, we need to care about /// insertion order we use [`IndexMap`] for this. /// diff --git a/src/recipe/error.rs b/src/recipe/error.rs index b56990583..d4f6a2995 100644 --- a/src/recipe/error.rs +++ b/src/recipe/error.rs @@ -190,7 +190,7 @@ pub struct PartialParsingError { pub kind: ErrorKind, } -// Implement Display for ErrorKind manually bacause [`marked_yaml::LoadError`] does not implement +// Implement Display for ErrorKind manually because [`marked_yaml::LoadError`] does not implement // the way we want it. // CAUTION: Because of this impl, we cannot use `#[error()]` on the enum. impl fmt::Display for ErrorKind { diff --git a/src/recipe/parser/build.rs b/src/recipe/parser/build.rs index 880168da9..f72cd4d9f 100644 --- a/src/recipe/parser/build.rs +++ b/src/recipe/parser/build.rs @@ -90,10 +90,10 @@ pub struct Build { /// Settings for shared libraries and executables #[serde(default, skip_serializing_if = "DynamicLinking::is_default")] pub(super) dynamic_linking: DynamicLinking, - /// Setting to control wether to always copy a file + /// Setting to control whether to always copy a file #[serde(default, skip_serializing_if = "GlobVec::is_empty")] pub(super) always_copy_files: GlobVec, - /// Setting to control wether to always include a file (even if it is already present in the host env) + /// Setting to control whether to always include a file (even if it is already present in the host env) #[serde(default, skip_serializing_if = "GlobVec::is_empty")] pub(super) always_include_files: GlobVec, /// Merge the build and host envs @@ -415,7 +415,7 @@ pub struct Python { #[serde(default, skip_serializing_if = "GlobVec::is_empty")] pub skip_pyc_compilation: GlobVec, - /// Wether to use the "app" entry point for Python (which hooks into the macOS GUI) + /// Whether to use the "app" entry point for Python (which hooks into the macOS GUI) /// This is only relevant for macOS. #[serde(default, skip_serializing_if = "std::ops::Not::not")] pub use_python_app_entrypoint: bool, diff --git a/src/recipe/parser/script.rs b/src/recipe/parser/script.rs index 239c689c4..aeb43300d 100644 --- a/src/recipe/parser/script.rs +++ b/src/recipe/parser/script.rs @@ -17,7 +17,7 @@ pub struct Script { /// Environment variables to set in the build environment. pub env: BTreeMap, /// Environment variables to leak into the build environment from the host system that - /// contain sensitve information. Use with care because this might make recipes no + /// contain sensitive information. Use with care because this might make recipes no /// longer reproducible on other machines. pub secrets: Vec, /// The contents of the script, either a path or a list of commands. @@ -171,7 +171,7 @@ impl Script { /// Get the secrets environment variables. /// /// Environment variables to leak into the build environment from the host system that - /// contain sensitve information. + /// contain sensitive information. /// /// # Warning /// Use with care because this might make recipes no longer reproducible on other machines. diff --git a/src/recipe/parser/test.rs b/src/recipe/parser/test.rs index 1cf96f3f5..37aa34225 100644 --- a/src/recipe/parser/test.rs +++ b/src/recipe/parser/test.rs @@ -47,7 +47,7 @@ pub struct CommandsTest { /// The (extra) requirements for the test. /// Similar to the `requirements` section in the recipe the `build` requirements /// are of the build-computer architecture and the `run` requirements are of the - /// target_platform architecture. The current package is implictly added to the + /// target_platform architecture. The current package is implicitly added to the /// `run` requirements. #[serde(default, skip_serializing_if = "CommandsTestRequirements::is_empty")] pub requirements: CommandsTestRequirements, @@ -83,7 +83,7 @@ fn is_true(value: &bool) -> bool { pub struct PythonTest { /// List of imports to test pub imports: Vec, - /// Wether to run `pip check` or not (default to true) + /// Whether to run `pip check` or not (default to true) #[serde(default = "pip_check_true", skip_serializing_if = "is_true")] pub pip_check: bool, } diff --git a/src/recipe_generator/cran.rs b/src/recipe_generator/cran.rs index e86dc2340..60acc5c13 100644 --- a/src/recipe_generator/cran.rs +++ b/src/recipe_generator/cran.rs @@ -65,7 +65,7 @@ pub struct CranOpts { #[arg(short, long)] universe: Option, - /// Wether to create recipes for the whole dependency tree or not + /// Whether to create recipes for the whole dependency tree or not #[arg(short, long)] tree: bool, @@ -393,7 +393,7 @@ mod tests { ("GPL (>= 2.15.1)", "GPL (>= 2.15.1)", None), // Creative Commons licenses ("CC BY-SA 4.0", "CC-BY-SA-4.0", None), - ("CC BY-NC-ND 3.0 US", "CC BY-NC-ND 3.0 US", None), // This one doesn't have a direct SPDX mapping + ("CC BY-NC-AND 3.0 US", "CC BY-NC-AND 3.0 US", None), // This one doesn't have a direct SPDX mapping // Multiple licenses with file ( "GPL-2 | GPL-3 | MIT + file LICENSE", diff --git a/src/source/copy_dir.rs b/src/source/copy_dir.rs index 59ff0a777..7e2ecf29b 100644 --- a/src/source/copy_dir.rs +++ b/src/source/copy_dir.rs @@ -86,7 +86,7 @@ pub(crate) fn copy_file( /// /// # Return /// -/// The returned `Vec` contains the pathes of the copied files. +/// The returned `Vec` contains the paths of the copied files. /// The `bool` flag indicates whether any of the _include_ globs matched. /// If a directory is created in this function, the path to the directory is _not_ returned. pub(crate) struct CopyDir<'a> { @@ -158,7 +158,7 @@ impl<'a> CopyDir<'a> { exclude_globs: make_glob_match_map(self.globvec.exclude_globs())?, }; - let copied_pathes = WalkBuilder::new(self.from_path) + let copied_paths = WalkBuilder::new(self.from_path) // disregard global gitignore .git_global(self.use_git_global) .git_ignore(self.use_gitignore) @@ -272,7 +272,7 @@ impl<'a> CopyDir<'a> { .filter_map(|res| res.transpose()) .collect::, SourceError>>()?; - result.copied_paths = copied_pathes; + result.copied_paths = copied_paths; Ok(result) } } diff --git a/src/source/extract.rs b/src/source/extract.rs index 21b676127..8db6ae275 100644 --- a/src/source/extract.rs +++ b/src/source/extract.rs @@ -194,7 +194,7 @@ mod test { #[test] fn test_extract_zip() { // zip contains text.txt with "Hello, World" text - const HELLOW_ZIP_FILE: &[u8] = &[ + const HELLO_WORLD_ZIP_FILE: &[u8] = &[ 80, 75, 3, 4, 10, 0, 0, 0, 0, 0, 244, 123, 36, 88, 144, 58, 246, 64, 13, 0, 0, 0, 13, 0, 0, 0, 8, 0, 28, 0, 116, 101, 120, 116, 46, 116, 120, 116, 85, 84, 9, 0, 3, 4, 130, 150, 101, 6, 130, 150, 101, 117, 120, 11, 0, 1, 4, 245, 1, 0, 0, 4, 20, 0, 0, 0, 72, @@ -212,7 +212,7 @@ mod test { let tempdir = tempfile::tempdir().unwrap(); let file_path = tempdir.path().join("test.zip"); let mut file = File::create(&file_path).unwrap(); - _ = file.write_all(HELLOW_ZIP_FILE); + _ = file.write_all(HELLO_WORLD_ZIP_FILE); let fancy_log = LoggingOutputHandler::from_multi_progress(multi_progress); let res = extract_zip(file_path, tempdir.path(), &fancy_log); diff --git a/src/tool_configuration.rs b/src/tool_configuration.rs index 24567e9d9..1121174ad 100644 --- a/src/tool_configuration.rs +++ b/src/tool_configuration.rs @@ -50,7 +50,7 @@ pub struct Configuration { /// Whether to only render the build output pub render_only: bool, - /// Wether to skip existing packages + /// Whether to skip existing packages pub skip_existing: SkipExisting, /// The channel configuration to use when parsing channels. diff --git a/typos.toml b/typos.toml new file mode 100644 index 000000000..ac8fa28b1 --- /dev/null +++ b/typos.toml @@ -0,0 +1,2 @@ +[default.extend-identifiers] +ratatui = "ratatui"