Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04471f7

Browse files
committed
Add perl additional dependencies test
1 parent 1295364 commit 04471f7

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use ExtUtils::MakeMaker;
2+
3+
WriteMakefile(
4+
NAME => "PreCommitDummy",
5+
VERSION => "0.0.1",
6+
);

pre_commit/store.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def _git_cmd(*args: str) -> None:
184184
LOCAL_RESOURCES = (
185185
'Cargo.toml', 'main.go', 'main.rs', '.npmignore', 'package.json',
186186
'pre_commit_dummy_package.gemspec', 'setup.py', 'environment.yml',
187+
'Makefile.PL',
187188
)
188189

189190
def make_local(self, deps: Sequence[str]) -> str:

tests/repository_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,3 +883,20 @@ def test_perl_hook(tempdir_factory, store):
883883
tempdir_factory, store, 'perl_hooks_repo',
884884
'perl-hook', [], b'Hello from perl-commit Perl!\n',
885885
)
886+
887+
888+
def test_local_perl_additional_dependencies(store):
889+
config = {
890+
'repo': 'local',
891+
'hooks': [{
892+
'id': 'hello',
893+
'name': 'hello',
894+
'entry': 'perltidy --version',
895+
'language': 'perl',
896+
'additional_dependencies': ['SHANCOCK/Perl-Tidy-20200110.tar.gz'],
897+
}],
898+
}
899+
hook = _get_hook(config, store, 'hello')
900+
ret, out = _hook_run(hook, (), color=False)
901+
assert ret == 0
902+
assert _norm_out(out).startswith(b'This is perltidy, v20200110')

0 commit comments

Comments
 (0)