summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhizhen He <hezhizhen.yi@gmail.com>2023-03-23 02:42:46 +0800
committerGitHub <noreply@github.com>2023-03-22 13:42:46 -0500
commit0f8a2d9363ce1356deea2acc34a5ce0cfcab9934 (patch)
treefe893bc28a6c7454a5e140bcfa179987c3db0aca
parentd350ccb2a3c76c8af7e65a5a72bc2c77c7e0aebf (diff)
chore: add spell checker to workflows (#4975)
* chore: add spell checker to workflows * fix: update config schema * fix: revert for fennel.rs
-rw-r--r--.github/config-schema.json4
-rw-r--r--.github/workflows/spell-check.yml10
-rw-r--r--Cargo.toml4
-rw-r--r--install/macos_packages/readme.md4
-rw-r--r--install/windows/main.wxs6
-rw-r--r--src/configs/fennel.rs5
-rw-r--r--src/configure.rs2
-rw-r--r--src/modules/env_var.rs2
-rw-r--r--src/modules/fennel.rs2
-rw-r--r--src/modules/nix_shell.rs4
-rw-r--r--src/modules/package.rs2
-rw-r--r--src/modules/rust.rs2
-rw-r--r--src/test/mod.rs2
-rw-r--r--typos.toml11
14 files changed, 41 insertions, 19 deletions
diff --git a/.github/config-schema.json b/.github/config-schema.json
index cf03dce7b..67988de3a 100644
--- a/.github/config-schema.json
+++ b/.github/config-schema.json
@@ -475,7 +475,7 @@
},
"fennel": {
"default": {
- "detect_extentions": [
+ "detect_extensions": [
"fnl"
],
"detect_files": [],
@@ -2955,7 +2955,7 @@
"default": true,
"type": "boolean"
},
- "detect_extentions": {
+ "detect_extensions": {
"default": [
"fnl"
],
diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml
new file mode 100644
index 000000000..b1838748f
--- /dev/null
+++ b/.github/workflows/spell-check.yml
@@ -0,0 +1,10 @@
+name: Spell Check
+on: [pull_request]
+
+jobs:
+ typos:
+ name: Spell Check with Typos
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: crate-ci/typos@v1.13.18
diff --git a/Cargo.toml b/Cargo.toml
index a4b85bcc5..271c27143 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,7 +34,7 @@ battery = ["starship-battery"]
config-schema = ["schemars"]
notify = ["notify-rust"]
-# Enables most of the `max-performace` features of the `gix` module for better performance.
+# Enables most of the `max-performance` features of the `gix` module for better performance.
# This can be more difficult to build in some conditions and requires cmake.
gix-max-perf = ["gix-features/zlib-ng", "gix/fast-sha1"]
# Slower than `git-repository-max-perf`, but better than the default.
@@ -53,7 +53,7 @@ gix = { version = "0.42.0", default-features = false, features = ["max-performan
gix-features = { version = "0.28.1", optional = true }
indexmap = { version = "1.9.2", features = ["serde"] }
log = { version = "0.4.17", features = ["std"] }
-# nofity-rust is optional (on by default) because the crate doesn't currently build for darwin with nix
+# notify-rust is optional (on by default) because the crate doesn't currently build for darwin with nix
# see: https://github.com/NixOS/nixpkgs/issues/160876
notify-rust = { version = "4.8.0", optional = true }
nu-ansi-term = "0.47.0"
diff --git a/install/macos_packages/readme.md b/install/macos_packages/readme.md
index 07cfac333..5b7aafddb 100644
--- a/install/macos_packages/readme.md
+++ b/install/macos_packages/readme.md
@@ -204,7 +204,7 @@ there are two .plist files that can be used to specify the architecture required
## Signing the Distribution package
-This is also fairly simple, and analagous to signing the binary.
+This is also fairly simple, and analogous to signing the binary.
```
productsign --timestamp --sign "<Key ID>" <input.pkg> <output.pkg>
@@ -212,7 +212,7 @@ productsign --timestamp --sign "<Key ID>" <input.pkg> <output.pkg>
## Notarizing the Distribution Package
-Also analagous to notarizing the binary. We run
+Also analogous to notarizing the binary. We run
```
xcrun notarytool submit <package.pkg> --keychain-profile "AC_PASSWORD" --wait
diff --git a/install/windows/main.wxs b/install/windows/main.wxs
index 41c2280b8..d07e31ed7 100644
--- a/install/windows/main.wxs
+++ b/install/windows/main.wxs
@@ -138,7 +138,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.
@@ -158,7 +158,7 @@
<!--
- Uncomment the next `WixVaraible` tag to customize the installer's
+ Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom banner image across
the top of each screen. See the WiX Toolset documentation for details
about customization.
@@ -180,4 +180,4 @@
</Product>
-</Wix> \ No newline at end of file
+</Wix>
diff --git a/src/configs/fennel.rs b/src/configs/fennel.rs
index e0564c9e6..a99002750 100644
--- a/src/configs/fennel.rs
+++ b/src/configs/fennel.rs
@@ -13,7 +13,8 @@ pub struct FennelConfig<'a> {
pub symbol: &'a str,
pub style: &'a str,
pub disabled: bool,
- pub detect_extentions: Vec<&'a str>,
+ #[serde(alias = "detect_extentions")] // TODO: remove it after breaking change releases
+ pub detect_extensions: Vec<&'a str>,
pub detect_files: Vec<&'a str>,
pub detect_folders: Vec<&'a str>,
}
@@ -26,7 +27,7 @@ impl<'a> Default for FennelConfig<'a> {
symbol: "🧅 ",
style: "bold green",
disabled: true,
- detect_extentions: vec!["fnl"],
+ detect_extensions: vec!["fnl"],
detect_files: vec![],
detect_folders: vec![],
}
diff --git a/src/configure.rs b/src/configure.rs
index ce7e55b2e..a77c83349 100644
--- a/src/configure.rs
+++ b/src/configure.rs
@@ -378,7 +378,7 @@ mod tests {
}
#[test]
- fn no_panic_when_editor_unparseable() {
+ fn no_panic_when_editor_unparsable() {
let outcome = edit_configuration(Some("\"vim"));
assert!(outcome.is_err());
}
diff --git a/src/modules/env_var.rs b/src/modules/env_var.rs
index 2d994f621..8e7358e20 100644
--- a/src/modules/env_var.rs
+++ b/src/modules/env_var.rs
@@ -70,7 +70,7 @@ pub fn module<'a>(name: Option<&str>, context: &'a Context) -> Option<Module<'a>
}
/// Filter `config` to only includes non-table values
-/// This filters the top-level table to only include its specific configuation
+/// This filters the top-level table to only include its specific configuration
fn filter_config(config: &toml::Value) -> Option<toml::Value> {
let o = config
.as_table()
diff --git a/src/modules/fennel.rs b/src/modules/fennel.rs
index 4b8a2fc98..82b1c7bf1 100644
--- a/src/modules/fennel.rs
+++ b/src/modules/fennel.rs
@@ -11,7 +11,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let is_fnl_project = context
.try_begin_scan()?
.set_files(&config.detect_files)
- .set_extensions(&config.detect_extentions)
+ .set_extensions(&config.detect_extensions)
.set_folders(&config.detect_folders)
.is_match();
diff --git a/src/modules/nix_shell.rs b/src/modules/nix_shell.rs
index 7913b95b6..d8666ee84 100644
--- a/src/modules/nix_shell.rs
+++ b/src/modules/nix_shell.rs
@@ -29,7 +29,7 @@ impl NixShellType {
}
}
- // Hack to detect if we're in a `nix shell` (in constrast to a `nix-shell`).
+ // Hack to detect if we're in a `nix shell` (in contrast to a `nix-shell`).
// A better way to do this will be enabled by https://github.com/NixOS/nix/issues/6677.
fn in_new_nix_shell(context: &Context) -> Option<()> {
let path = context.get_env("PATH")?;
@@ -45,7 +45,7 @@ impl NixShellType {
/// The module will use the `$IN_NIX_SHELL` and `$name` environment variable to
/// determine if it's inside a nix-shell and the name of it.
///
-/// The following options are availables:
+/// The following options are available:
/// - `impure_msg` (string) // change the impure msg
/// - `pure_msg` (string) // change the pure msg
/// - `unknown_msg` (string) // change the unknown message
diff --git a/src/modules/package.rs b/src/modules/package.rs
index dfe9f6eba..8c8480ab6 100644
--- a/src/modules/package.rs
+++ b/src/modules/package.rs
@@ -238,7 +238,7 @@ fn get_cargo_version(context: &Context, config: &PackageConfig) -> Option<String
// workspace version string (`package.version.worspace = true`)
// need to read the Cargo.toml file from the workspace root
let mut version = None;
- // disover the workspace root
+ // discover the workspace root
for path in context.current_dir.ancestors().skip(1) {
// Assume the workspace root is the first ancestor that contains a Cargo.toml file
if let Ok(mut file) = fs::File::open(path.join("Cargo.toml")) {
diff --git a/src/modules/rust.rs b/src/modules/rust.rs
index 5e5a97578..b266f6f06 100644
--- a/src/modules/rust.rs
+++ b/src/modules/rust.rs
@@ -93,7 +93,7 @@ impl RustToolingEnvironmentInfo {
fn get_rustup_rustc_version(&self, context: &Context) -> &RustupRunRustcVersionOutcome {
self.rustup_rustc_output.get_or_init(|| {
let out = if let Some(toolchain) = self.get_env_toolchain_override(context) {
- // First try runnig ~/.rustup/toolchains/<toolchain>/bin/rustc --version
+ // First try running ~/.rustup/toolchains/<toolchain>/bin/rustc --version
rustup_home()
.map(|rustup_folder| {
rustup_folder
diff --git a/src/test/mod.rs b/src/test/mod.rs
index 973e0f5e8..48bb51ad3 100644
--- a/src/test/mod.rs
+++ b/src/test/mod.rs
@@ -28,7 +28,7 @@ fn init_logger() {
let nul = if cfg!(windows) { "nul" } else { "/dev/null" };
let nul = PathBuf::from(nul);
- // Maxmimum log level
+ // Maximum log level
log::set_max_level(LevelFilter::Trace);
logger.set_log_level(Level::Trace);
logger.set_log_file_path(nul);
diff --git a/typos.toml b/typos.toml
new file mode 100644
index 000000000..bc511ced4
--- /dev/null
+++ b/typos.toml
@@ -0,0 +1,11 @@
+# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
+[default.extend-words]
+mis = "mis"
+Nd = "Nd"
+edn = "edn"
+esy = "esy"
+numver = "numver"
+afe = "afe"
+extentions = "extentions" # TODO: should be extensions
+[files]
+extend-exclude = ["CHANGELOG.md", "docs/*"]