diff --git a/crates/prek-consts/src/env_vars.rs b/crates/prek-consts/src/env_vars.rs index a60475970..b90d49fd2 100644 --- a/crates/prek-consts/src/env_vars.rs +++ b/crates/prek-consts/src/env_vars.rs @@ -99,6 +99,7 @@ impl EnvVars { pub const PREK_CONTAINER_RUNTIME: &'static str = "PREK_CONTAINER_RUNTIME"; pub const PREK_DOCKER_NO_INIT: &'static str = "PREK_DOCKER_NO_INIT"; pub const PREK_QUIET: &'static str = "PREK_QUIET"; + pub const PREK_VERBOSE: &'static str = "PREK_VERBOSE"; // PREK internal environment variables pub const PREK_INTERNAL__TEST_DIR: &'static str = "PREK_INTERNAL__TEST_DIR"; diff --git a/crates/prek/src/cli/hook_impl.rs b/crates/prek/src/cli/hook_impl.rs index db4dcf670..0d2520c49 100644 --- a/crates/prek/src/cli/hook_impl.rs +++ b/crates/prek/src/cli/hook_impl.rs @@ -33,6 +33,7 @@ pub(crate) async fn hook_impl( skip_on_missing_config: bool, script_version: Option, args: Vec, + verbose: bool, printer: Printer, ) -> Result { let stdin = read_hook_stdin(hook_type).await?; @@ -138,7 +139,7 @@ pub(crate) async fn hook_impl( false, false, run_args.extra, - false, + verbose, printer, ) .await?; diff --git a/crates/prek/src/cli/mod.rs b/crates/prek/src/cli/mod.rs index a14e1d6c9..85aa101f4 100644 --- a/crates/prek/src/cli/mod.rs +++ b/crates/prek/src/cli/mod.rs @@ -208,7 +208,10 @@ pub(crate) struct GlobalArgs { pub quiet: u8, /// Use verbose output. - #[arg(global = true, short, long, action = ArgAction::Count)] + /// + /// When running hooks, this also prints a hook's `description`, if set, whenever the + /// hook fails, to help explain the failure. + #[arg(global = true, short, long, env = EnvVars::PREK_VERBOSE, action = ArgAction::Count)] pub(crate) verbose: u8, /// Write trace logs to the specified file. diff --git a/crates/prek/src/cli/run/run.rs b/crates/prek/src/cli/run/run.rs index d1f09669f..3662ec074 100644 --- a/crates/prek/src/cli/run/run.rs +++ b/crates/prek/src/cli/run/run.rs @@ -1005,6 +1005,16 @@ impl<'a> HookRunSession<'a> { "{detail_prefix}{}", format!("- hook id: {}", result.hook.id).dimmed() )?; + if status == RunStatus::Failed + && (self.verbose || result.hook.verbose) + && let Some(description) = result.hook.description.as_deref() + { + writeln!( + stdout, + "{detail_prefix}{}", + format!("- description: {description}").dimmed() + )?; + } if self.verbose || result.hook.verbose { writeln!( stdout, diff --git a/crates/prek/src/config.rs b/crates/prek/src/config.rs index a5232a325..e41285714 100644 --- a/crates/prek/src/config.rs +++ b/crates/prek/src/config.rs @@ -595,7 +595,8 @@ pub(crate) struct HookOptions { /// Append filenames that would be checked to the hook entry as arguments. /// Default is true. pub pass_filenames: Option, - /// A description of the hook. For metadata only. + /// A description of the hook, shown in listings and printed on failure when verbose output is + /// enabled (via `--verbose`/`PREK_VERBOSE` or `verbose: true`). pub description: Option, /// Run the hook on a specific version of the language. /// Default is `default`. diff --git a/crates/prek/src/main.rs b/crates/prek/src/main.rs index 49b663e92..9c6778df6 100644 --- a/crates/prek/src/main.rs +++ b/crates/prek/src/main.rs @@ -333,6 +333,7 @@ async fn run(cli: Cli) -> Result { args.skip_on_missing_config, args.script_version, args.args, + cli.globals.verbose > 0, printer, ) .await diff --git a/crates/prek/tests/hook_impl.rs b/crates/prek/tests/hook_impl.rs index c0d112498..ff2b49c62 100644 --- a/crates/prek/tests/hook_impl.rs +++ b/crates/prek/tests/hook_impl.rs @@ -58,6 +58,62 @@ fn hook_impl() { "); } +/// Test that `PREK_VERBOSE=1` makes a Git-triggered hook (e.g. `git commit`) print a +/// failing hook's `description`, since Git does not let users pass CLI flags like +/// `--verbose` through to the underlying `prek hook-impl` invocation. +#[test] +fn hook_impl_verbose_env_var_prints_hook_description() { + let context = TestContext::new(); + context.init_project(); + context.write_pre_commit_config(indoc! { r" + repos: + - repo: local + hooks: + - id: fail + name: fail + description: This hook always fails. + language: fail + entry: always fail + always_run: true + "}); + + context.git_add("."); + + let mut commit = git_cmd(context.work_dir()); + commit + .arg("commit") + .env(EnvVars::PREK_HOME, &**context.home_dir()) + .env(EnvVars::PREK_VERBOSE, "1") + .arg("-m") + .arg("Initial commit"); + + cmd_snapshot!(context.filters(), context.install(), @r#" + success: true + exit_code: 0 + ----- stdout ----- + prek installed at `.git/hooks/pre-commit` + + ----- stderr ----- + "#); + + cmd_snapshot!(context.filters(), commit, @r" + success: false + exit_code: 1 + ----- stdout ----- + + ----- stderr ----- + fail.....................................................................Failed + - hook id: fail + - description: This hook always fails. + - duration: [TIME] + - exit code: 1 + + always fail + + .pre-commit-config.yaml + "); +} + #[test] fn hook_impl_allows_missing_hook_dir() -> anyhow::Result<()> { let context = TestContext::new(); diff --git a/crates/prek/tests/run.rs b/crates/prek/tests/run.rs index e455912a3..e976a73ae 100644 --- a/crates/prek/tests/run.rs +++ b/crates/prek/tests/run.rs @@ -1519,6 +1519,105 @@ fn fail_fast_cli_flag() { "); } +/// Test that `--verbose` prints a hook's `description` when it fails, to help +/// explain the failure without needing to inspect the config file. +#[test] +fn verbose_prints_hook_description_on_failure() { + let context = TestContext::new(); + context.init_project(); + + context.write_pre_commit_config(indoc::indoc! {r#" + repos: + - repo: local + hooks: + - id: failing-hook + name: failing-hook + description: Checks that things are correct. + language: system + entry: python3 -c 'print("Failed"); exit(1)' + always_run: true + - id: passing-hook + name: passing-hook + description: This one always passes. + language: system + entry: python3 -c 'print("Passed")' + always_run: true + "#}); + context.git_add("."); + + // Without `--verbose`, the description is not shown. + cmd_snapshot!(context.filters(), context.run(), @r" + success: false + exit_code: 1 + ----- stdout ----- + failing-hook.............................................................Failed + - hook id: failing-hook + - exit code: 1 + + Failed + passing-hook.............................................................Passed + + ----- stderr ----- + "); + + // With `--verbose`, the description is shown only for the failing hook. + cmd_snapshot!(context.filters(), context.run().arg("--verbose"), @r" + success: false + exit_code: 1 + ----- stdout ----- + failing-hook.............................................................Failed + - hook id: failing-hook + - description: Checks that things are correct. + - duration: [TIME] + - exit code: 1 + + Failed + passing-hook.............................................................Passed + - hook id: passing-hook + - duration: [TIME] + + Passed + + ----- stderr ----- + "); +} + +/// Test that `PREK_VERBOSE` environment variable enables the same behavior as `--verbose`, +/// which is needed since Git-triggered hooks (e.g. `git commit`) can't be passed CLI flags. +#[test] +fn prek_verbose_env_var_prints_hook_description_on_failure() { + let context = TestContext::new(); + context.init_project(); + + context.write_pre_commit_config(indoc::indoc! {r#" + repos: + - repo: local + hooks: + - id: failing-hook + name: failing-hook + description: Checks that things are correct. + language: system + entry: python3 -c 'print("Failed"); exit(1)' + always_run: true + "#}); + context.git_add("."); + + cmd_snapshot!(context.filters(), context.run().env(EnvVars::PREK_VERBOSE, "1"), @r" + success: false + exit_code: 1 + ----- stdout ----- + failing-hook.............................................................Failed + - hook id: failing-hook + - description: Checks that things are correct. + - duration: [TIME] + - exit code: 1 + + Failed + + ----- stderr ----- + "); +} + /// Test --no-fail-fast CLI flag overrides config-level `fail_fast`. #[test] fn no_fail_fast_cli_flag() { diff --git a/docs/authoring-hooks.md b/docs/authoring-hooks.md index f4c566dab..05f2699da 100644 --- a/docs/authoring-hooks.md +++ b/docs/authoring-hooks.md @@ -34,7 +34,7 @@ each manifest hook: | `always_run` | No | No | boolean | Run even when no files match. | | `fail_fast` | No | No | boolean | Stop the run immediately if this hook fails. | | `pass_filenames` | No | No | boolean or positive integer | Control whether, or how many, matching filenames are passed. | -| `description` | No | No | string | Free-form metadata shown in listings. | +| `description` | No | No | string | Free-form metadata shown in listings; printed on failure when `--verbose` is enabled. | | `language_version` | No | No | string | Language/toolchain version request. | | `log_file` | No | No | string path | Write hook output to a file when the hook fails or is verbose. | | `require_serial` | No | No | boolean | Avoid concurrent invocations of this hook. | diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 21f9d3134..5c5d606c9 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -113,8 +113,9 @@ prek install [OPTIONS] [HOOK|PROJECT]...

Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).

-
--verbose, -v

Use verbose output

-
--version, -V

Display the prek version

+
--verbose, -v

Use verbose output.

+

When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

+

May also be set with the PREK_VERBOSE environment variable.

--version, -V

Display the prek version

## prek prepare-hooks @@ -178,8 +179,9 @@ prek prepare-hooks [OPTIONS] [HOOK|PROJECT]...

Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).

-
--verbose, -v

Use verbose output

-
--version, -V

Display the prek version

+
--verbose, -v

Use verbose output.

+

When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

+

May also be set with the PREK_VERBOSE environment variable.

--version, -V

Display the prek version

## prek run @@ -270,8 +272,9 @@ prek run [OPTIONS] [HOOK|PROJECT]...
  • pre-rebase
  • prepare-commit-msg
  • --to-ref, --origin, -o to-ref

    The destination ref in a from_ref...to_ref diff expression. Defaults to HEAD if from_ref is specified

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek list @@ -383,8 +386,9 @@ prek list [OPTIONS] [HOOK|PROJECT]...

    Can be specified multiple times. Also accepts PREK_SKIP or SKIP environment variables (comma-delimited).

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek uninstall @@ -433,8 +437,9 @@ prek uninstall [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek validate-config @@ -469,8 +474,9 @@ prek validate-config [OPTIONS] [CONFIG]...
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek validate-manifest @@ -505,8 +511,9 @@ prek validate-manifest [OPTIONS] [MANIFEST]...
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek sample-config @@ -543,8 +550,9 @@ prek sample-config [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek update @@ -594,8 +602,9 @@ prek update [OPTIONS]
    --repo-include-tag repo=pattern

    Only consider tags matching this glob pattern for a repository (<repo>=<pattern>). This option may be specified multiple times. Overrides the effective include filters for the named repository.

    When set for a repository, this overrides any global --include-tag filters for that repository.

    For example, use --repo-include-tag https://github.com/example/repo=v* to only consider version tags for one repository.

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek cache @@ -643,8 +652,9 @@ prek cache dir [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek cache gc @@ -675,8 +685,9 @@ prek cache gc [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek cache clean @@ -706,8 +717,9 @@ prek cache clean [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek cache size @@ -738,8 +750,9 @@ prek cache size [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek try-repo @@ -828,8 +841,9 @@ prek try-repo [OPTIONS] [HOOK|PROJECT]...
  • pre-rebase
  • prepare-commit-msg
  • --to-ref, --origin, -o to-ref

    The destination ref in a from_ref...to_ref diff expression. Defaults to HEAD if from_ref is specified

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek util @@ -887,8 +901,9 @@ prek util identify [OPTIONS] [PATH]...
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek util list-builtins @@ -923,8 +938,9 @@ prek util list-builtins [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek util init-template-dir @@ -975,8 +991,9 @@ prek util init-template-dir [OPTIONS]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ### prek util yaml-to-toml @@ -1013,8 +1030,9 @@ prek util yaml-to-toml [OPTIONS] [CONFIG]
    --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    -
    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +
    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    ## prek self @@ -1065,6 +1083,7 @@ prek self update [OPTIONS] [TARGET_VERSION]

    Repeating this option, e.g., -qq, will enable a silent mode in which prek will write no output to stdout.

    May also be set with the PREK_QUIET environment variable.

    --refresh

    Refresh all cached data

    --token token

    A GitHub token for authentication. A token is not required but can be used to reduce the chance of encountering rate limits

    -

    May also be set with the GITHUB_TOKEN environment variable.

    --verbose, -v

    Use verbose output

    -
    --version, -V

    Display the prek version

    +

    May also be set with the GITHUB_TOKEN environment variable.

    --verbose, -v

    Use verbose output.

    +

    When running hooks, this also prints a hook's description, if set, whenever the hook fails, to help explain the failure.

    +

    May also be set with the PREK_VERBOSE environment variable.

    --version, -V

    Display the prek version

    diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 4fb7f1a5e..27b8affc5 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -1328,7 +1328,9 @@ Write hook output to a file when the hook fails (and also when `verbose: true`). ### `description` -Free-form description shown in listings / metadata. +Free-form description shown in listings / metadata. When `--verbose` (or the `PREK_VERBOSE` +environment variable) is enabled, this description is also printed if the hook fails, to help +explain why the hook exists and what it checks. - Type: string diff --git a/docs/usage.md b/docs/usage.md index 798b6b6cd..e9a28bd4f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -165,6 +165,15 @@ Use verbose output when a hook fails without enough context: prek run -vvv ``` +If a hook defines a `description` in the config, `--verbose` also prints it when the +hook fails, which can help explain what the hook checks for. This works for `prek run` +as well as for hooks triggered by Git (e.g. `git commit`); for the latter, set the +`PREK_VERBOSE` environment variable since Git does not forward CLI flags to the hook: + +```bash +PREK_VERBOSE=1 git commit +``` + prek also writes a log file to `~/.cache/prek/prek.log` by default. See [Debugging](debugging.md) when reporting a prek problem. diff --git a/prek.schema.json b/prek.schema.json index 12428d278..9fdc9b23f 100644 --- a/prek.schema.json +++ b/prek.schema.json @@ -353,7 +353,7 @@ "$ref": "#/definitions/PassFilenames" }, "description": { - "description": "A description of the hook. For metadata only.", + "description": "A description of the hook, shown in listings and, when `--verbose` is enabled, printed\nif the hook fails to help explain the failure.", "type": "string" }, "language_version": { @@ -619,7 +619,7 @@ "$ref": "#/definitions/PassFilenames" }, "description": { - "description": "A description of the hook. For metadata only.", + "description": "A description of the hook, shown in listings and, when `--verbose` is enabled, printed\nif the hook fails to help explain the failure.", "type": "string" }, "language_version": { @@ -790,7 +790,7 @@ "$ref": "#/definitions/PassFilenames" }, "description": { - "description": "A description of the hook. For metadata only.", + "description": "A description of the hook, shown in listings and, when `--verbose` is enabled, printed\nif the hook fails to help explain the failure.", "type": "string" }, "language_version": { @@ -966,7 +966,7 @@ "$ref": "#/definitions/PassFilenames" }, "description": { - "description": "A description of the hook. For metadata only.", + "description": "A description of the hook, shown in listings and, when `--verbose` is enabled, printed\nif the hook fails to help explain the failure.", "type": "string" }, "language_version": {