mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
allow rust hooks to specify arbitrary cargo install parameters
We've replaced the previous "--feature=" format with a single parameter "--" which marks the start of the "cargo install" arguments, so now we can use "-- --features foo", "-- --locked", etc. Fixes #3162
This commit is contained in:
parent
bd153a698a
commit
558793bbc2
2 changed files with 22 additions and 23 deletions
|
|
@ -125,6 +125,6 @@ def test_run_features_additional_dependencies(tmp_path):
|
|||
_make_hello_world(tmp_path)
|
||||
|
||||
deps = ('shellharden:4.2.0', 'git-version')
|
||||
features = ('--feature=foo',)
|
||||
ret = run_language(tmp_path, rust, 'hello_world', deps=deps + features)
|
||||
cargo_params = ('--', '--features', 'foo')
|
||||
ret = run_language(tmp_path, rust, 'hello_world', deps=deps + cargo_params)
|
||||
assert ret == (0, b'Hello, world!\nWith feature foo\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue