Skip to content

Commit 986f9ae

Browse files
committed
Refactor Rust toolchain management
- Reuse system installed rustup - Reuse installed rustup across hooks - Reuse installed Rust toolchains across hooks
1 parent db20094 commit 986f9ae

File tree

11 files changed

+573
-400
lines changed

11 files changed

+573
-400
lines changed

crates/prek-consts/src/env_vars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl EnvVars {
3434
"PREK_INTERNAL__RUN_ORIGINAL_PRE_COMMIT";
3535
pub const PREK_INTERNAL__GO_BINARY_NAME: &'static str = "PREK_INTERNAL__GO_BINARY_NAME";
3636
pub const PREK_INTERNAL__NODE_BINARY_NAME: &'static str = "PREK_INTERNAL__NODE_BINARY_NAME";
37-
pub const PREK_INTERNAL__RUST_BINARY_NAME: &'static str = "PREK_INTERNAL__RUST_BINARY_NAME";
37+
pub const PREK_INTERNAL__RUSTUP_BINARY_NAME: &'static str = "PREK_INTERNAL__RUST_BINARY_NAME";
3838
pub const PREK_GENERATE: &'static str = "PREK_GENERATE";
3939

4040
// Python & uv related

docs/todo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The original pre-commit supports hooks written in 10+ languages. The table below
1515
| python ⭐ | ✅ Supported || `prek` supports automatic version management of Python toolchains. |
1616
| node | ✅ Supported || |
1717
| golang | ✅ Supported || |
18+
| rust | ✅ Supported || |
1819
| lua | ✅ Supported || |
1920
| system | ✅ Supported || |
2021
| script | ✅ Supported || |
@@ -24,7 +25,6 @@ The original pre-commit supports hooks written in 10+ languages. The table below
2425
| fail | ✅ Supported || |
2526
| deno ⭐ | 🚧 WIP || Experimental support in `prek`; upstream `pre-commit` lacks a native `deno` language. |
2627
| ruby | 🚧 WIP | [#43](https://github.com/j178/prek/issues/43) | `prek` does not currently support downloading new Ruby versions, but can use multiple simultaneously installed interpreters |
27-
| rust | 🚧 Planned | [#44](https://github.com/j178/prek/issues/44) | |
2828
| conda | 🚧 Planned | [#52](https://github.com/j178/prek/issues/52) | |
2929
| coursier | 🚧 Planned | [#53](https://github.com/j178/prek/issues/53) | |
3030
| dart | 🚧 Planned | [#51](https://github.com/j178/prek/issues/51) | |

src/languages/golang/golang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl LanguageImpl for Golang {
3030
let progress = reporter.on_install_start(&hook);
3131

3232
// 1. Install Go
33-
let go_dir = store.tools_path(crate::store::ToolBucket::Go);
33+
let go_dir = store.tools_path(ToolBucket::Go);
3434
let installer = GoInstaller::new(go_dir);
3535

3636
let (version, allows_download) = match &hook.language_request {

0 commit comments

Comments
 (0)