In version 2.54, the pre-commit hook is broken. It fails due to missing dependencies. Observed on pre-commit-4.6.0.
squawk: the "@squawk-cli/darwin-arm64" optional dependency was not installed.
I think this is because squawk-cli switched from a postinstall download script to platform-specific optional npm packages. Pre-commit's node environment does not install optional dependencies, so the binary is never available.
Reproduction steps:
- repo: https://github.com/sbdchd/squawk
rev: c3dc1e6ca2b5b6b4fafee8f3647cf8e0f99a9ae2 # frozen: v2.54.0
hooks:
- id: squawk
name: squawk
types: [sql]
squawk...................................................................Failed
- hook id: squawk
- exit code: 1
squawk: the "@squawk-cli/darwin-arm64" optional dependency was not installed.
This usually means your package manager skipped optional dependencies. Re-install with optional dependencies enabled (e.g. "npm install --include=optional").
squawk: the "@squawk-cli/darwin-arm64" optional dependency was not installed.
This usually means your package manager skipped optional dependencies. Re-install with optional dependencies enabled (e.g. "npm install --include=optional").
Attempted workaround: The problem is that just adding packages in additional_dependencies doesn't work because node checks the platform. However, we have a steup that requires Darwin as well as Linux:
additional_dependencies: # does not work!
- "@squawk-cli/darwin-arm64@2.54.0"
- "@squawk-cli/darwin-x64@2.54.0"
- "@squawk-cli/linux-arm64@2.54.0"
Potential fix: Convert the pre-commit hook to language: rust. But this seems to require changes in Cargo.toml and I'm out of my depth there :)
In version 2.54, the pre-commit hook is broken. It fails due to missing dependencies. Observed on pre-commit-4.6.0.
I think this is because
squawk-cliswitched from a postinstall download script to platform-specific optional npm packages. Pre-commit's node environment does not install optional dependencies, so the binary is never available.Reproduction steps:
Attempted workaround: The problem is that just adding packages in
additional_dependenciesdoesn't work because node checks the platform. However, we have a steup that requires Darwin as well as Linux:Potential fix: Convert the pre-commit hook to
language: rust. But this seems to require changes inCargo.tomland I'm out of my depth there :)