test rust directly

This commit is contained in:
Anthony Sottile 2023-01-29 18:27:10 -05:00
parent 6eacdd440e
commit 2adca78c6f
7 changed files with 61 additions and 128 deletions

View file

@ -3,7 +3,6 @@ from __future__ import annotations
import os
from typing import Sequence
import pre_commit.constants as C
from pre_commit.languages.all import Language
from pre_commit.prefix import Prefix
@ -14,10 +13,11 @@ def run_language(
exe: str,
args: Sequence[str] = (),
file_args: Sequence[str] = (),
version: str = C.DEFAULT,
version: str | None = None,
deps: Sequence[str] = (),
) -> tuple[int, bytes]:
prefix = Prefix(str(path))
version = version or language.get_default_version()
language.install_environment(prefix, version, deps)
with language.in_env(prefix, version):

View file

@ -1,5 +0,0 @@
- id: rust-hook
name: rust example hook
entry: rust-hello-world
language: rust
files: ''

View file

@ -1,3 +0,0 @@
[[package]]
name = "rust-hello-world"
version = "0.1.0"

View file

@ -1,3 +0,0 @@
[package]
name = "rust-hello-world"
version = "0.1.0"

View file

@ -1,3 +0,0 @@
fn main() {
println!("hello world");
}