1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-05 21:07:52 +00:00

chore: add spell checker to workflows (#4975)

* chore: add spell checker to workflows

* fix: update config schema

* fix: revert for fennel.rs
This commit is contained in:
Zhizhen He 2023-03-23 02:42:46 +08:00 committed by GitHub
parent d350ccb2a3
commit 0f8a2d9363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 41 additions and 19 deletions

View File

@ -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"
],

10
.github/workflows/spell-check.yml vendored Normal file
View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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>
</Wix>

View File

@ -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![],
}

View File

@ -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());
}

View File

@ -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()

View File

@ -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();

View File

@ -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

View File

@ -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")) {

View File

@ -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

View File

@ -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);

11
typos.toml Normal file
View File

@ -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/*"]