Added fix end of file hook.

This commit is contained in:
Anthony Sottile
2014-03-22 21:49:10 -07:00
parent 8c30419c13
commit dc1494d0e7
13 changed files with 15 additions and 16 deletions

View File

@@ -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

View File

@@ -50,4 +50,4 @@ def get_validator(
return obj
return validate
return validate

View File

@@ -9,4 +9,4 @@ SUPPORTED_LANGUAGES = set([
'python',
'ruby',
'node',
])
])

View File

@@ -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

View File

@@ -21,4 +21,4 @@ languages = {
'node': node,
'python': python,
'ruby': ruby,
}
}

View File

@@ -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)

View File

@@ -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']

View File

@@ -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

View File

@@ -1,2 +1,2 @@
- foo
- bar
- bar

View File

@@ -1 +1 @@
foo: "
foo: "

View File

@@ -1 +1 @@
foo: bar
foo: bar

View File

@@ -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')

View File

@@ -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'])