Skip to content
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

Add codespell (config, workflow) to catch typos + catch and fix some of those #329

Merged
merged 11 commits into from
Sep 12, 2023
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
skip = .git,*.pdf,*.svg,Cargo.lock,**/pixi.lock,install/windows/resources/LICENSE.rtf
# all images and other binaries embedded in .ipynb jsons
# also ignore a case in the test
ignore-regex = "image/png": ".*|^ *".*data:\S+;base64.*|verion = "2.12"
ignore-words-list = crate,ser
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ repos:
types: [file, rust]
entry: cargo test
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The script will inform you once the installation is successful and add the ~/.pi

## Install from source

`pixi` is 100% written in Rust and therefor it can be installed, build and tested with cargo.
`pixi` is 100% written in Rust and therefore it can be installed, build and tested with cargo.
To start using `pixi` from a source build run:

```shell
Expand Down Expand Up @@ -248,4 +248,4 @@ community. [Join our discord server today!][chat-url]
<a name="pixibuilt"></a>
## Built using pixi

To see whats being built with `pixi` check out the [Community](/docs/Community.md) page.
To see what's being built with `pixi` check out the [Community](/docs/Community.md) page.
2 changes: 1 addition & 1 deletion docs/advanced/advanced_tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Next to running actual executable like `./myprogram`, `cmake` or `python` the sh

### Syntax

- **Boolean list:** use `&&` or `||` to seperate two commands.
- **Boolean list:** use `&&` or `||` to separate two commands.
- `&&`: if the command before `&&` succeeds continue with the next command.
- `||`: if the command before `||` fails continue with the next command.
- **Sequential lists:** use `;` to run two commands without checking if the fist command failed or succeeded.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/multi_platform_configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ To deal with this you can define your activation scripts using the target defini
scripts = ["setup.sh", "local_setup.bash"]

[target.win-64.activation]
scritps = ["setup.ps1", "setup.bat", "local_setup.bat"]
scripts = ["setup.ps1", "setup.bat", "local_setup.bat"]
```
When this project is run on `win-64` it will only execute the target scripts not the scripts specified in the default `activation.scripts`
2 changes: 1 addition & 1 deletion docs/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ On Linux, one can use `GNOME Keyring` (or just Keyring) to access credentials th

## Fallback storage

If you run on a server with none of the aformentioned keychains available, then pixi falls back to store the credentials in an _insecure_ JSON file. This JSON file is located at `~/.rattler/rattler_auth_store.json` and contains the credentials.
If you run on a server with none of the aforementioned keychains available, then pixi falls back to store the credentials in an _insecure_ JSON file. This JSON file is located at `~/.rattler/rattler_auth_store.json` and contains the credentials.
2 changes: 1 addition & 1 deletion docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The installer will download pixi and add it to the path.

### Install from source

pixi is 100% written in Rust and therefor it can be installed, build and
pixi is 100% written in Rust and therefore it can be installed, build and
tested with cargo.
To start using pixi from a source build run:

Expand Down
2 changes: 1 addition & 1 deletion docs/vision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Modern package managers like `cargo` have shown us, how great a package manager
We want to make pixi a great experience for everyone, so we have a few values that we want to uphold:

1. **Fast**. We want to have a fast package manager, that is able to solve the environment in a few seconds.
2. **User Friendly**. We want to have a package manager that puts user friendliness on the front-line. Providing easy, accesible and intuitive commands. That have the element of _least surprise_.
2. **User Friendly**. We want to have a package manager that puts user friendliness on the front-line. Providing easy, accessible and intuitive commands. That have the element of _least surprise_.
3. **Isolated Environment**. We want to have isolated environments, that are reproducible and easy to share. Ideally, it should run on all common platforms. The Conda packaging system provides an excellent base for this.
4. **Single Tool**. We want to integrate most common uses when working on a development project with Pixi, so it should support at least dependency management, command management, building and uploading packages. You should not need to reach to another external tool for this.
5. **Fun**. It should be fun to use pixi and not cause frustrations, you should not need to think about it a lot and it should generally just get out of your way.
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These are examples that are hosted in other repositories that use pixi for build

### AI

[Lama.cpp](https://github.com/tdejager/llama.cpp)
[Llama.cpp](https://github.com/tdejager/llama.cpp)

### Games

Expand Down
4 changes: 2 additions & 2 deletions examples/opencv/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OpenCV example
OpenCV is a powerfull tool to do computer vision and fully opensource.
OpenCV is a powerful tool to do computer vision and fully opensource.

Here are some example on how to use it with `pixi`.

Expand All @@ -25,4 +25,4 @@ After that press `ESC` which will start the calibration.

When the calibration is done the camera will be used again to find the distance to the checkerboard.

![callibrated camera result](https://github.com/ruben-arts/pixi/assets/12893423/f42825d7-5010-4805-9f6b-b02075395413)
![calibrated camera result](https://github.com/ruben-arts/pixi/assets/12893423/f42825d7-5010-4805-9f6b-b02075395413)
2 changes: 1 addition & 1 deletion install/windows/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

1. Comment out or remove the two `Publish` tags that follow the
`WixVariable` tag.
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag futher down
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag further down
3. Replace the `Value` attribute of the `WixVariable` tag with
the path to a RTF file that will be used as the EULA and
displayed in the license agreement dialog.
Expand Down
2 changes: 1 addition & 1 deletion src/cli/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn default_authentication_storage() -> AuthenticationStorage {
AuthenticationStorage::new("rattler", &get_default_auth_store_location())
}

// moved into seperate function to access from info command
// moved into separate function to access from info command
pub fn get_default_auth_store_location() -> PathBuf {
dirs::home_dir().unwrap().join(".rattler")
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
let gitignore_path = dir.join(".gitignore");
let gitattributes_path = dir.join(".gitattributes");

// Check if the project file doesnt already exist. We don't want to overwrite it.
// Check if the project file doesn't already exist. We don't want to overwrite it.
if fs::metadata(&manifest_path).map_or(false, |x| x.is_file()) {
miette::bail!("{} already exists", consts::PROJECT_MANIFEST);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub async fn create_script(task: Task, args: Vec<String>) -> miette::Result<Sequ
deno_task_shell::parser::parse(full_script.trim()).map_err(|e| miette!("{e}"))
}

/// Executes the given command withing the specified project and with the given environment.
/// Executes the given command within the specified project and with the given environment.
pub async fn execute_script(
script: SequentialList,
project: &Project,
Expand Down
6 changes: 3 additions & 3 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::{
time::Duration,
};

/// Returns the prefix associated with the given environment. If the prefix doesnt exist or is not
/// Returns the prefix associated with the given environment. If the prefix doesn't exist or is not
/// up to date it is updated.
pub async fn get_up_to_date_prefix(project: &Project) -> miette::Result<Prefix> {
// Make sure the project supports the current platform
Expand Down Expand Up @@ -397,7 +397,7 @@ pub async fn execute_transaction(
// Open the package cache
let package_cache = PackageCache::new(cache_dir.join("pkgs"));

// Create an install driver which helps limit the number of concurrent fileystem operations
// Create an install driver which helps limit the number of concurrent filesystem operations
let install_driver = InstallDriver::default();

// Define default installation options.
Expand Down Expand Up @@ -587,7 +587,7 @@ async fn install_package_to_environment(
link: None,
};

// Create the conda-meta directory if it doesnt exist yet.
// Create the conda-meta directory if it doesn't exist yet.
let target_prefix = target_prefix.to_path_buf();
match tokio::task::spawn_blocking(move || {
let conda_meta_path = target_prefix.join("conda-meta");
Expand Down
2 changes: 1 addition & 1 deletion src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Prefix {
}

impl Prefix {
/// Constructs a new instance. Returns an error if the directory doesnt exist.
/// Constructs a new instance. Returns an error if the directory doesn't exist.
pub fn new(path: impl Into<PathBuf>) -> miette::Result<Self> {
let root = path.into();
Ok(Self { root })
Expand Down
2 changes: 1 addition & 1 deletion src/project/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ pub struct Activation {
pub scripts: Option<Vec<String>>,
}

// Create an error report for usign a platform that is not supported by the project.
// Create an error report for using a platform that is not supported by the project.
fn create_unsupported_platform_report(
source: NamedSource,
span: Range<usize>,
Expand Down
2 changes: 1 addition & 1 deletion src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl Project {
deps_table: &mut Item,
spec: &MatchSpec,
) -> miette::Result<(PackageName, NamelessMatchSpec)> {
// If it doesnt exist create a proper table
// If it doesn't exist create a proper table
if deps_table.is_none() {
*deps_table = Item::Table(Table::new());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/install_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn test_incremental_lock_file() {
.unwrap();

// Force using version 2 of `foo`. This should force `foo` to version `2` but `bar` should still
// remaing on `1` because it was previously locked
// remaining on `1` because it was previously locked
pixi.add("foo >=2").await.unwrap();

let lock = pixi.lock_file().await.unwrap();
Expand Down