Skip to content

Commit

Permalink
ci: Check for typos with typos (#962)
Browse files Browse the repository at this point in the history
* ci: Check for typos with typos

* docs: update CLI docs
  • Loading branch information
Hofer-Julian authored Jul 5, 2024
1 parent 5543db6 commit 1cdd6dd
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 34 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Check spelling
uses: crate-ci/[email protected]
6 changes: 3 additions & 3 deletions docs/build_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: ['**']`.

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,21 @@ Generate a recipe for a Python package from PyPI
- Possible values: `true`, `false`


- `-u`, `--use-mapping`

Whether to use the conda-forge PyPI name mapping

- Default value: `true`
- Possible values: `true`, `false`


- `-t`, `--tree`

Whether to generate recipes for all dependencies

- Possible values: `true`, `false`





Expand All @@ -632,7 +647,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`

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/recipe_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/linux/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
}
Expand Down
6 changes: 3 additions & 3 deletions src/package_test/content_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
let last_elem = splitted.pop().unwrap_or_default();
let mut site_package_path = splitted.join("/");
let mut split = site_package.glob().split('.').collect::<Vec<_>>();
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('/');
}
Expand Down
4 changes: 2 additions & 2 deletions src/recipe/custom_yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions src/recipe/custom_yaml/rendered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion src/recipe/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/recipe/parser/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/recipe/parser/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Script {
/// Environment variables to set in the build environment.
pub env: BTreeMap<String, String>,
/// 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<String>,
/// The contents of the script, either a path or a list of commands.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/recipe/parser/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -83,7 +83,7 @@ fn is_true(value: &bool) -> bool {
pub struct PythonTest {
/// List of imports to test
pub imports: Vec<String>,
/// 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,
}
Expand Down
2 changes: 1 addition & 1 deletion src/recipe_generator/cran.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct CranOpts {
#[arg(short, long)]
universe: Option<String>,

/// 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,

Expand Down
6 changes: 3 additions & 3 deletions src/source/copy_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) fn copy_file(
///
/// # Return
///
/// The returned `Vec<PathBuf>` contains the pathes of the copied files.
/// The returned `Vec<PathBuf>` 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> {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -272,7 +272,7 @@ impl<'a> CopyDir<'a> {
.filter_map(|res| res.transpose())
.collect::<Result<Vec<_>, SourceError>>()?;

result.copied_paths = copied_pathes;
result.copied_paths = copied_paths;
Ok(result)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/source/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/tool_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-identifiers]
ratatui = "ratatui"
ND = "ND"

0 comments on commit 1cdd6dd

Please sign in to comment.