mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Make local hooks work
This commit is contained in:
7
pre_commit/resources/empty_template/Cargo.toml
Normal file
7
pre_commit/resources/empty_template/Cargo.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "__fake_crate"
|
||||
version = "0.0.0"
|
||||
|
||||
[[bin]]
|
||||
name = "__fake_cmd"
|
||||
path = "main.rs"
|
||||
1
pre_commit/resources/empty_template/main.rs
Normal file
1
pre_commit/resources/empty_template/main.rs
Normal file
@@ -0,0 +1 @@
|
||||
fn main() {}
|
||||
@@ -604,6 +604,24 @@ def test_local_golang_additional_dependencies(store):
|
||||
assert _norm_out(ret[1]) == b"Hello, Go examples!\n"
|
||||
|
||||
|
||||
def test_local_rust_additional_dependencies(store):
|
||||
config = {
|
||||
'repo': 'local',
|
||||
'hooks': [{
|
||||
'id': 'hello',
|
||||
'name': 'hello',
|
||||
'entry': 'hello',
|
||||
'language': 'rust',
|
||||
'additional_dependencies': ['cli:hello-cli:0.2.2'],
|
||||
}],
|
||||
}
|
||||
repo = Repository.create(config, store)
|
||||
(_, hook), = repo.hooks
|
||||
ret = repo.run_hook(hook, ())
|
||||
assert ret[0] == 0
|
||||
assert _norm_out(ret[1]) == b"Hello World!\n"
|
||||
|
||||
|
||||
def test_reinstall(tempdir_factory, store, log_info_mock):
|
||||
path = make_repo(tempdir_factory, 'python_hooks_repo')
|
||||
config = make_config_from_repo(path)
|
||||
|
||||
Reference in New Issue
Block a user