diff --git a/.cargo/audit.toml b/.cargo/audit.toml new file mode 100644 index 0000000..dde09a6 --- /dev/null +++ b/.cargo/audit.toml @@ -0,0 +1,2 @@ +[advisories] +ignore = ["RUSTSEC-2023-0071"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..66730c7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,66 @@ +fail_fast: true + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + args: + - --allow-multiple-documents + - id: check-toml + - id: check-added-large-files + - id: check-merge-conflict + + - repo: https://github.com/crate-ci/typos + rev: v1.31.1 + hooks: + - id: typos + args: ["--force-exclude"] + + - repo: local + hooks: + - id: fmt + name: fmt + description: Format files with cargo fmt. + entry: cargo +nightly fmt + language: system + types: [rust] + args: ["--", "--check"] + # For some reason some formatting is different depending on how you invoke? + pass_filenames: false + + - id: clippy + name: clippy + description: Lint rust sources + entry: cargo clippy + language: system + args: ["--", "-D", "warnings"] + types: [file] + files: (\.rs|Cargo.lock)$ + pass_filenames: false + + - id: audit + name: audit + description: Audit packages + entry: cargo audit + language: system + pass_filenames: false + verbose: true + always_run: true + + - id: test + name: test + description: Rust test + entry: cargo test + language: system + args: ["--workspace"] + types: [file] + files: (\.rs|Cargo.lock)$ + pass_filenames: false + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint diff --git a/src/animals.txt b/src/animals.txt index d90bc70..fe46b3a 100644 --- a/src/animals.txt +++ b/src/animals.txt @@ -1661,7 +1661,6 @@ whoopingcrane widgeon widowspider wildcat -wildebeast wildebeest willet wireworm diff --git a/src/ldap.rs b/src/ldap.rs index 16543c3..f854e12 100644 --- a/src/ldap.rs +++ b/src/ldap.rs @@ -13,9 +13,9 @@ pub enum LdapError { Ldap(#[from] ldap3::LdapError), #[error("Key error: {0}")] FailedToParseKey(#[from] russh::Error), - #[error("Mising environment variable: {0}")] + #[error("Missing environment variable: {0}")] MissingEnvironmentVariable(&'static str), - #[error("Mising environment variable: {0}")] + #[error("Could not read password file: {0}")] CouldNotReadPasswordFile(#[from] std::io::Error), }