mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-26 02:49:09 -06:00
Added fix end of file hook.
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
|
||||
- repo: git@github.com:pre-commit/pre-commit-hooks
|
||||
sha: 12794c1c19c001e3d05bcfe316b4f93b414035a7
|
||||
sha: 76739902911688e8d7b13241409f9facc0e534e4
|
||||
hooks:
|
||||
- id: pyflakes
|
||||
files: '\.py$'
|
||||
- id: debug-statements
|
||||
files: '\.py$'
|
||||
- id: trailing-whitespace
|
||||
files: '\.(py|sh)$'
|
||||
files: '\.(py|sh|yaml)$'
|
||||
- id: name-tests-test
|
||||
files: 'tests/.+\.py$'
|
||||
- id: end-of-file-fixer
|
||||
files: '\.(py|sh|yaml)$'
|
||||
|
||||
- repo: git@github.com:pre-commit/pre-commit
|
||||
sha: 47b7ca44ed1fcaa83464ed00cef72049ae22c33d
|
||||
|
||||
@@ -50,4 +50,4 @@ def get_validator(
|
||||
|
||||
return obj
|
||||
|
||||
return validate
|
||||
return validate
|
||||
|
||||
@@ -9,4 +9,4 @@ SUPPORTED_LANGUAGES = set([
|
||||
'python',
|
||||
'ruby',
|
||||
'node',
|
||||
])
|
||||
])
|
||||
|
||||
@@ -18,4 +18,4 @@ def in_hooks_workspace():
|
||||
local.path(get_pre_commit_dir_path()).mkdir()
|
||||
|
||||
with local.cwd(get_pre_commit_dir_path()):
|
||||
yield
|
||||
yield
|
||||
|
||||
@@ -21,4 +21,4 @@ languages = {
|
||||
'node': node,
|
||||
'python': python,
|
||||
'ruby': ruby,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,4 @@ def install_environment():
|
||||
|
||||
def run_hook(hook, file_args):
|
||||
with in_env() as env:
|
||||
return helpers.run_hook(env, hook, file_args)
|
||||
return helpers.run_hook(env, hook, file_args)
|
||||
|
||||
@@ -69,4 +69,4 @@ def test_raises_when_additional_validation_fails(additional_validator):
|
||||
|
||||
def test_returns_object_after_validating(noop_validator):
|
||||
ret = noop_validator('tests/data/array_yaml_file.yaml')
|
||||
assert ret == ['foo', 'bar']
|
||||
assert ret == ['foo', 'bar']
|
||||
|
||||
@@ -59,4 +59,4 @@ def is_valid_according_to_schema(obj, schema):
|
||||
))
|
||||
def test_is_valid_according_to_schema(manifest_obj, expected):
|
||||
ret = is_valid_according_to_schema(manifest_obj, MANIFEST_JSON_SCHEMA)
|
||||
assert ret is expected
|
||||
assert ret is expected
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
- foo
|
||||
- bar
|
||||
- bar
|
||||
|
||||
@@ -1 +1 @@
|
||||
foo: "
|
||||
foo: "
|
||||
|
||||
@@ -1 +1 @@
|
||||
foo: bar
|
||||
foo: bar
|
||||
|
||||
@@ -12,4 +12,4 @@ def test_all_languages_have_repo_setups():
|
||||
@pytest.mark.parametrize('language', C.SUPPORTED_LANGUAGES)
|
||||
def test_all_languages_support_interface(language):
|
||||
assert hasattr(languages[language], 'install_environment')
|
||||
assert hasattr(languages[language], 'run_hook')
|
||||
assert hasattr(languages[language], 'run_hook')
|
||||
|
||||
@@ -104,6 +104,3 @@ def test_sha(mock_repo_config):
|
||||
def test_languages(config_for_python_pre_commit_git_repo):
|
||||
repo = Repository(config_for_python_pre_commit_git_repo)
|
||||
assert repo.languages == set(['python'])
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user