Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ same-file = { version = "1.0.6" }
semver = { version = "1.0.24", features = ["serde"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_ignored = { version = "0.1.12" }
serde_json = { version = "1.0.132", features = ["unbounded_depth"] }
serde_json = { version = "1.0.132", features = ["preserve_order", "unbounded_depth"] }
serde_stacker = { version = "0.1.12" }
serde_yaml = { version = "0.9.34" }
shlex = { version = "1.3.0" }
similar = "2.7.0"
target-lexicon = { version = "0.13.0" }
tempfile = { version = "3.13.0" }
textwrap = { version = "0.16.1" }
Expand Down
4 changes: 4 additions & 0 deletions src/builtin/pre_commit_hooks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod fix_end_of_file;
mod fix_trailing_whitespace;
mod mixed_line_ending;
mod no_commit_to_branch;
mod pretty_format_json;

pub(crate) enum Implemented {
TrailingWhitespace,
Expand All @@ -34,6 +35,7 @@ pub(crate) enum Implemented {
MixedLineEnding,
DetectPrivateKey,
NoCommitToBranch,
PrettyFormatJson,
}

impl FromStr for Implemented {
Expand All @@ -54,6 +56,7 @@ impl FromStr for Implemented {
"mixed-line-ending" => Ok(Self::MixedLineEnding),
"detect-private-key" => Ok(Self::DetectPrivateKey),
"no-commit-to-branch" => Ok(Self::NoCommitToBranch),
"pretty-format-json" => Ok(Self::PrettyFormatJson),
_ => Err(()),
}
}
Expand Down Expand Up @@ -92,6 +95,7 @@ impl Implemented {
Self::MixedLineEnding => mixed_line_ending::mixed_line_ending(hook, filenames).await,
Self::DetectPrivateKey => detect_private_key::detect_private_key(hook, filenames).await,
Self::NoCommitToBranch => no_commit_to_branch::no_commit_to_branch(hook).await,
Self::PrettyFormatJson => pretty_format_json::pretty_format_json(hook, filenames).await,
}
}
}
Expand Down
Loading