Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pre_commit/clientlib/validate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class InvalidConfigError(FatalError):
'language_version': {'type': 'string'},
'args': {
'type': 'array',
'default': [],
'items': {'type': 'string'},
},
},
Expand Down
7 changes: 7 additions & 0 deletions pre_commit/clientlib/validate_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class InvalidManifestError(ValueError):
'language_version': {'type': 'string', 'default': 'default'},
'files': {'type': 'string'},
'expected_return_value': {'type': 'number', 'default': 0},
'args': {
'type': 'array',
'default': [],
'items': {
'type': 'string',
},
},
},
'required': ['id', 'name', 'entry', 'language', 'files'],
},
Expand Down
1 change: 1 addition & 0 deletions testing/resources/arg_per_line_hooks_repo/hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
entry: bin/hook.sh
language: script
files: ''
args: [hello, world]
2 changes: 2 additions & 0 deletions tests/manifest_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def manifest(store, tmpdir_factory):
def test_manifest_contents(manifest):
# Should just retrieve the manifest contents
assert manifest.manifest_contents == [{
'args': [],
'description': '',
'entry': 'bin/hook.sh',
'expected_return_value': 0,
Expand All @@ -32,6 +33,7 @@ def test_manifest_contents(manifest):

def test_hooks(manifest):
assert manifest.hooks['bash_hook'] == {
'args': [],
'description': '',
'entry': 'bin/hook.sh',
'expected_return_value': 0,
Expand Down
4 changes: 3 additions & 1 deletion tests/repository_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def test_run_a_script_hook(tmpdir_factory, store):
def test_run_hook_with_spaced_args(tmpdir_factory, store):
_test_hook_repo(
tmpdir_factory, store, 'arg_per_line_hooks_repo',
'arg-per-line', ['foo bar', 'baz'], 'arg: foo bar\narg: baz\n',
'arg-per-line',
['foo bar', 'baz'],
'arg: hello\narg: world\narg: foo bar\narg: baz\n',
)


Expand Down