mirror of
https://github.com/crate-ci/typos.git
synced 2025-02-15 09:33:00 -05:00
commit
ec8713ae84
16 changed files with 72 additions and 50 deletions
|
@ -1 +1 @@
|
||||||
msrv = "1.60.0" # MSRV
|
msrv = "1.64.0" # MSRV
|
||||||
|
|
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -51,7 +51,7 @@ jobs:
|
||||||
- name: No-default features
|
- name: No-default features
|
||||||
run: cargo test --workspace --no-default-features
|
run: cargo test --workspace --no-default-features
|
||||||
msrv:
|
msrv:
|
||||||
name: "Check MSRV: 1.60.0"
|
name: "Check MSRV: 1.64.0"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
@ -59,7 +59,7 @@ jobs:
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.60.0 # MSRV
|
toolchain: 1.64.0 # MSRV
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
@ -113,7 +113,7 @@ jobs:
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.60.0 # MSRV
|
toolchain: 1.64.0 # MSRV
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
components: clippy
|
components: clippy
|
||||||
|
|
4
.github/workflows/rust-next.yml
vendored
4
.github/workflows/rust-next.yml
vendored
|
@ -59,9 +59,9 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
rust:
|
rust:
|
||||||
- 1.60.0 # MSRV
|
- 1.64.0 # MSRV
|
||||||
- stable
|
- stable
|
||||||
continue-on-error: ${{ matrix.rust != '1.60.0' }} # MSRV
|
continue-on-error: ${{ matrix.rust != '1.64.0' }} # MSRV
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1121,9 +1121,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-exit"
|
name = "proc-exit"
|
||||||
version = "1.0.3"
|
version = "2.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0da6bbc8ef87314d4f596ad9d02db375c3f2d77fba91067a6f6a5754fdc8cb49"
|
checksum = "d2d778539881515d37cd91925d169f4a351120c5a1b44fce2b7c462b0d7f4ec6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-error"
|
name = "proc-macro-error"
|
||||||
|
|
|
@ -14,7 +14,7 @@ readme = "README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -73,7 +73,7 @@ bstr = "1.0"
|
||||||
once_cell = "1.15.0"
|
once_cell = "1.15.0"
|
||||||
ahash = "0.8"
|
ahash = "0.8"
|
||||||
difflib = "0.4"
|
difflib = "0.4"
|
||||||
proc-exit = "1.0"
|
proc-exit = "2.0"
|
||||||
human-panic = "1.0.3"
|
human-panic = "1.0.3"
|
||||||
content_inspector = "0.2.4"
|
content_inspector = "0.2.4"
|
||||||
unicode-segmentation = "1.10.0"
|
unicode-segmentation = "1.10.0"
|
||||||
|
|
|
@ -9,7 +9,7 @@ categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
license = "CC-BY-SA-3.0"
|
license = "CC-BY-SA-3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
publish = false
|
publish = false
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -7,7 +7,7 @@ categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling", "no_std"]
|
keywords = ["development", "spelling", "no_std"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -28,9 +28,9 @@ impl<V> DictTrie<V> {
|
||||||
match child.children {
|
match child.children {
|
||||||
DictTrieChild::Nested(n) => {
|
DictTrieChild::Nested(n) => {
|
||||||
let byte = bytes[i];
|
let byte = bytes[i];
|
||||||
let index = if (b'a'..b'z').contains(&byte) {
|
let index = if (b'a'..=b'z').contains(&byte) {
|
||||||
byte - b'a'
|
byte - b'a'
|
||||||
} else if (b'A'..b'Z').contains(&byte) {
|
} else if (b'A'..=b'Z').contains(&byte) {
|
||||||
byte - b'A'
|
byte - b'A'
|
||||||
} else {
|
} else {
|
||||||
return self.unicode.find(word);
|
return self.unicode.find(word);
|
||||||
|
|
|
@ -9,7 +9,7 @@ categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
publish = false
|
publish = false
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -9,7 +9,7 @@ readme = "../../README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -9,7 +9,7 @@ readme = "../../README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -9,7 +9,7 @@ readme = "../../README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -8,7 +8,7 @@ repository = "https://github.com/crate-ci/typos"
|
||||||
readme = "../../README.md"
|
readme = "../../README.md"
|
||||||
categories = ["text-processing"]
|
categories = ["text-processing"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -9,7 +9,7 @@ readme = "../../README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
|
|
@ -9,7 +9,7 @@ readme = "README.md"
|
||||||
categories = ["development-tools", "text-processing"]
|
categories = ["development-tools", "text-processing"]
|
||||||
keywords = ["development", "spelling"]
|
keywords = ["development", "spelling"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60.0" # MSRV
|
rust-version = "1.64.0" # MSRV
|
||||||
publish = false
|
publish = false
|
||||||
include = [
|
include = [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -5,7 +5,7 @@ use clap::Parser;
|
||||||
mod args;
|
mod args;
|
||||||
mod report;
|
mod report;
|
||||||
|
|
||||||
use proc_exit::WithCodeResultExt;
|
use proc_exit::prelude::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
human_panic::setup_panic!();
|
human_panic::setup_panic!();
|
||||||
|
@ -19,7 +19,7 @@ fn run() -> proc_exit::ExitResult {
|
||||||
Ok(args) => args,
|
Ok(args) => args,
|
||||||
Err(e) if e.use_stderr() => {
|
Err(e) if e.use_stderr() => {
|
||||||
let _ = e.print();
|
let _ = e.print();
|
||||||
return proc_exit::Code::USAGE_ERR.ok();
|
return proc_exit::sysexits::USAGE_ERR.ok();
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let _ = e.print();
|
let _ = e.print();
|
||||||
|
@ -52,19 +52,24 @@ fn run() -> proc_exit::ExitResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_dump_config(args: &args::Args, output_path: &std::path::Path) -> proc_exit::ExitResult {
|
fn run_dump_config(args: &args::Args, output_path: &std::path::Path) -> proc_exit::ExitResult {
|
||||||
let global_cwd = std::env::current_dir()?;
|
let global_cwd = std::env::current_dir().to_sysexits()?;
|
||||||
|
|
||||||
let path = &args.path[0];
|
let path = &args.path[0];
|
||||||
let cwd = if path == std::path::Path::new("-") {
|
let cwd = if path == std::path::Path::new("-") {
|
||||||
global_cwd
|
global_cwd
|
||||||
} else if path.is_file() {
|
} else if path.is_file() {
|
||||||
let mut cwd = path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?;
|
let mut cwd = path
|
||||||
|
.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?;
|
||||||
cwd.pop();
|
cwd.pop();
|
||||||
cwd
|
cwd
|
||||||
} else {
|
} else {
|
||||||
path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?
|
path.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?
|
||||||
};
|
};
|
||||||
let cwd = cwd.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?;
|
let cwd = cwd
|
||||||
|
.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?;
|
||||||
|
|
||||||
let storage = typos_cli::policy::ConfigStorage::new();
|
let storage = typos_cli::policy::ConfigStorage::new();
|
||||||
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
||||||
|
@ -72,8 +77,8 @@ fn run_dump_config(args: &args::Args, output_path: &std::path::Path) -> proc_exi
|
||||||
|
|
||||||
let mut overrides = typos_cli::config::Config::default();
|
let mut overrides = typos_cli::config::Config::default();
|
||||||
if let Some(path) = args.custom_config.as_ref() {
|
if let Some(path) = args.custom_config.as_ref() {
|
||||||
let custom =
|
let custom = typos_cli::config::Config::from_file(path)
|
||||||
typos_cli::config::Config::from_file(path).with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
overrides.update(&custom);
|
overrides.update(&custom);
|
||||||
}
|
}
|
||||||
overrides.update(&args.config.to_config());
|
overrides.update(&args.config.to_config());
|
||||||
|
@ -81,35 +86,42 @@ fn run_dump_config(args: &args::Args, output_path: &std::path::Path) -> proc_exi
|
||||||
|
|
||||||
let config = engine
|
let config = engine
|
||||||
.load_config(&cwd)
|
.load_config(&cwd)
|
||||||
.with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
|
|
||||||
let mut defaulted_config = typos_cli::config::Config::from_defaults();
|
let mut defaulted_config = typos_cli::config::Config::from_defaults();
|
||||||
defaulted_config.update(&config);
|
defaulted_config.update(&config);
|
||||||
let output =
|
let output =
|
||||||
toml_edit::easy::to_string_pretty(&defaulted_config).with_code(proc_exit::Code::FAILURE)?;
|
toml_edit::easy::to_string_pretty(&defaulted_config).with_code(proc_exit::Code::FAILURE)?;
|
||||||
if output_path == std::path::Path::new("-") {
|
if output_path == std::path::Path::new("-") {
|
||||||
std::io::stdout().write_all(output.as_bytes())?;
|
std::io::stdout()
|
||||||
|
.write_all(output.as_bytes())
|
||||||
|
.to_sysexits()?;
|
||||||
} else {
|
} else {
|
||||||
std::fs::write(output_path, &output)?;
|
std::fs::write(output_path, &output).to_sysexits()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_type_list(args: &args::Args) -> proc_exit::ExitResult {
|
fn run_type_list(args: &args::Args) -> proc_exit::ExitResult {
|
||||||
let global_cwd = std::env::current_dir()?;
|
let global_cwd = std::env::current_dir().to_sysexits()?;
|
||||||
|
|
||||||
let path = &args.path[0];
|
let path = &args.path[0];
|
||||||
let cwd = if path == std::path::Path::new("-") {
|
let cwd = if path == std::path::Path::new("-") {
|
||||||
global_cwd
|
global_cwd
|
||||||
} else if path.is_file() {
|
} else if path.is_file() {
|
||||||
let mut cwd = path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?;
|
let mut cwd = path
|
||||||
|
.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?;
|
||||||
cwd.pop();
|
cwd.pop();
|
||||||
cwd
|
cwd
|
||||||
} else {
|
} else {
|
||||||
path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?
|
path.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?
|
||||||
};
|
};
|
||||||
let cwd = cwd.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?;
|
let cwd = cwd
|
||||||
|
.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?;
|
||||||
|
|
||||||
let storage = typos_cli::policy::ConfigStorage::new();
|
let storage = typos_cli::policy::ConfigStorage::new();
|
||||||
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
||||||
|
@ -117,8 +129,8 @@ fn run_type_list(args: &args::Args) -> proc_exit::ExitResult {
|
||||||
|
|
||||||
let mut overrides = typos_cli::config::Config::default();
|
let mut overrides = typos_cli::config::Config::default();
|
||||||
if let Some(path) = args.custom_config.as_ref() {
|
if let Some(path) = args.custom_config.as_ref() {
|
||||||
let custom =
|
let custom = typos_cli::config::Config::from_file(path)
|
||||||
typos_cli::config::Config::from_file(path).with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
overrides.update(&custom);
|
overrides.update(&custom);
|
||||||
}
|
}
|
||||||
overrides.update(&args.config.to_config());
|
overrides.update(&args.config.to_config());
|
||||||
|
@ -126,13 +138,13 @@ fn run_type_list(args: &args::Args) -> proc_exit::ExitResult {
|
||||||
|
|
||||||
engine
|
engine
|
||||||
.init_dir(&cwd)
|
.init_dir(&cwd)
|
||||||
.with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
let definitions = engine.file_types(&cwd);
|
let definitions = engine.file_types(&cwd);
|
||||||
|
|
||||||
let stdout = std::io::stdout();
|
let stdout = std::io::stdout();
|
||||||
let mut handle = stdout.lock();
|
let mut handle = stdout.lock();
|
||||||
for (name, globs) in definitions {
|
for (name, globs) in definitions {
|
||||||
writeln!(handle, "{}: {}", name, itertools::join(globs, ", "))?;
|
writeln!(handle, "{}: {}", name, itertools::join(globs, ", ")).to_sysexits()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -143,7 +155,7 @@ fn run_checks(
|
||||||
stdout_palette: report::Palette,
|
stdout_palette: report::Palette,
|
||||||
stderr_palette: report::Palette,
|
stderr_palette: report::Palette,
|
||||||
) -> proc_exit::ExitResult {
|
) -> proc_exit::ExitResult {
|
||||||
let global_cwd = std::env::current_dir()?;
|
let global_cwd = std::env::current_dir().to_sysexits()?;
|
||||||
|
|
||||||
let storage = typos_cli::policy::ConfigStorage::new();
|
let storage = typos_cli::policy::ConfigStorage::new();
|
||||||
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
let mut engine = typos_cli::policy::ConfigEngine::new(&storage);
|
||||||
|
@ -151,8 +163,8 @@ fn run_checks(
|
||||||
|
|
||||||
let mut overrides = typos_cli::config::Config::default();
|
let mut overrides = typos_cli::config::Config::default();
|
||||||
if let Some(path) = args.custom_config.as_ref() {
|
if let Some(path) = args.custom_config.as_ref() {
|
||||||
let custom =
|
let custom = typos_cli::config::Config::from_file(path)
|
||||||
typos_cli::config::Config::from_file(path).with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
overrides.update(&custom);
|
overrides.update(&custom);
|
||||||
}
|
}
|
||||||
overrides.update(&args.config.to_config());
|
overrides.update(&args.config.to_config());
|
||||||
|
@ -164,16 +176,19 @@ fn run_checks(
|
||||||
let cwd = if path == std::path::Path::new("-") {
|
let cwd = if path == std::path::Path::new("-") {
|
||||||
global_cwd.clone()
|
global_cwd.clone()
|
||||||
} else if path.is_file() {
|
} else if path.is_file() {
|
||||||
let mut cwd = path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?;
|
let mut cwd = path
|
||||||
|
.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?;
|
||||||
cwd.pop();
|
cwd.pop();
|
||||||
cwd
|
cwd
|
||||||
} else {
|
} else {
|
||||||
path.canonicalize().with_code(proc_exit::Code::USAGE_ERR)?
|
path.canonicalize()
|
||||||
|
.with_code(proc_exit::sysexits::USAGE_ERR)?
|
||||||
};
|
};
|
||||||
|
|
||||||
engine
|
engine
|
||||||
.init_dir(&cwd)
|
.init_dir(&cwd)
|
||||||
.with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
let walk_policy = engine.walk(&cwd);
|
let walk_policy = engine.walk(&cwd);
|
||||||
|
|
||||||
let threads = if path.is_file() { 1 } else { args.threads };
|
let threads = if path.is_file() { 1 } else { args.threads };
|
||||||
|
@ -193,9 +208,11 @@ fn run_checks(
|
||||||
for pattern in walk_policy.extend_exclude.iter() {
|
for pattern in walk_policy.extend_exclude.iter() {
|
||||||
overrides
|
overrides
|
||||||
.add(&format!("!{}", pattern))
|
.add(&format!("!{}", pattern))
|
||||||
.with_code(proc_exit::Code::CONFIG_ERR)?;
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
}
|
}
|
||||||
let overrides = overrides.build().with_code(proc_exit::Code::CONFIG_ERR)?;
|
let overrides = overrides
|
||||||
|
.build()
|
||||||
|
.with_code(proc_exit::sysexits::CONFIG_ERR)?;
|
||||||
walk.overrides(overrides);
|
walk.overrides(overrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +251,12 @@ fn run_checks(
|
||||||
}
|
}
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
e.io_error()
|
e.io_error()
|
||||||
.map(|i| proc_exit::Code::from(i.kind()))
|
.map(|i| {
|
||||||
|
let kind = i.kind();
|
||||||
|
proc_exit::sysexits::io_to_sysexists(kind)
|
||||||
|
.or_else(|| proc_exit::bash::io_to_signal(kind))
|
||||||
|
.unwrap_or(proc_exit::sysexits::IO_ERR)
|
||||||
|
})
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.with_message(e)
|
.with_message(e)
|
||||||
})?;
|
})?;
|
||||||
|
@ -253,7 +275,7 @@ fn run_checks(
|
||||||
// `Failure` from something else and get it mixed up with typos.
|
// `Failure` from something else and get it mixed up with typos.
|
||||||
//
|
//
|
||||||
// Can't use DataErr or anything else an std::io::ErrorKind might map to.
|
// Can't use DataErr or anything else an std::io::ErrorKind might map to.
|
||||||
proc_exit::Code::UNKNOWN.ok()
|
proc_exit::Code::new(2).ok()
|
||||||
} else {
|
} else {
|
||||||
proc_exit::Code::SUCCESS.ok()
|
proc_exit::Code::SUCCESS.ok()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue