mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Add perl additional dependencies test
This commit is contained in:
parent
1295364986
commit
04471f7d97
3 changed files with 24 additions and 0 deletions
6
pre_commit/resources/empty_template_Makefile.PL
Normal file
6
pre_commit/resources/empty_template_Makefile.PL
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
NAME => "PreCommitDummy",
|
||||
VERSION => "0.0.1",
|
||||
);
|
||||
|
|
@ -184,6 +184,7 @@ class Store:
|
|||
LOCAL_RESOURCES = (
|
||||
'Cargo.toml', 'main.go', 'main.rs', '.npmignore', 'package.json',
|
||||
'pre_commit_dummy_package.gemspec', 'setup.py', 'environment.yml',
|
||||
'Makefile.PL',
|
||||
)
|
||||
|
||||
def make_local(self, deps: Sequence[str]) -> str:
|
||||
|
|
|
|||
|
|
@ -883,3 +883,20 @@ def test_perl_hook(tempdir_factory, store):
|
|||
tempdir_factory, store, 'perl_hooks_repo',
|
||||
'perl-hook', [], b'Hello from perl-commit Perl!\n',
|
||||
)
|
||||
|
||||
|
||||
def test_local_perl_additional_dependencies(store):
|
||||
config = {
|
||||
'repo': 'local',
|
||||
'hooks': [{
|
||||
'id': 'hello',
|
||||
'name': 'hello',
|
||||
'entry': 'perltidy --version',
|
||||
'language': 'perl',
|
||||
'additional_dependencies': ['SHANCOCK/Perl-Tidy-20200110.tar.gz'],
|
||||
}],
|
||||
}
|
||||
hook = _get_hook(config, store, 'hello')
|
||||
ret, out = _hook_run(hook, (), color=False)
|
||||
assert ret == 0
|
||||
assert _norm_out(out).startswith(b'This is perltidy, v20200110')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue