Skip to content

Commit

Permalink
Use hook args in fast path (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 authored Dec 10, 2024
1 parent fefb241 commit 5a2c894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/builtin/pre_commit_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) async fn fix_trailing_whitespace(
_env_vars: Arc<HashMap<&'static str, String>>,
) -> Result<(i32, Vec<u8>)> {
let entry = shlex::split(&hook.entry).ok_or(anyhow::anyhow!("Failed to parse entry"))?;
let args = Args::try_parse_from(entry)?;
let args = Args::try_parse_from(entry.iter().chain(&hook.args))?;

// Validate markdown extensions
if args.markdown_linebreak_ext.contains(&String::new()) {
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ pub struct ConfigRemoteHook {
pub id: String,
/// Override the name of the hook.
pub name: Option<String>,
/// Not documented in the official docs.
/// Override the entrypoint. Not documented in the official docs but works.
pub entry: Option<String>,
/// Not documented in the official docs.
/// Override the language. Not documented in the official docs but works.
pub language: Option<Language>,
#[serde(flatten)]
pub options: HookOptions,
Expand Down

0 comments on commit 5a2c894

Please sign in to comment.