From dc1494d0e761cb429847a57f4268bda7cf0d1a99 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 22 Mar 2014 21:49:10 -0700 Subject: [PATCH] Added fix end of file hook. --- .pre-commit-config.yaml | 6 ++++-- pre_commit/clientlib/validate_base.py | 2 +- pre_commit/constants.py | 2 +- pre_commit/hooks_workspace.py | 2 +- pre_commit/languages/all.py | 2 +- pre_commit/languages/ruby.py | 2 +- tests/clientlib/validate_base_test.py | 2 +- tests/clientlib/validate_manifest_test.py | 2 +- tests/data/array_yaml_file.yaml | 2 +- tests/data/non_parseable_yaml_file.yaml | 2 +- tests/data/valid_yaml_but_invalid_manifest.yaml | 2 +- tests/languages/all_test.py | 2 +- tests/repository_test.py | 3 --- 13 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f348d78e..b3907cc3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/pre_commit/clientlib/validate_base.py b/pre_commit/clientlib/validate_base.py index d29d6fdf..37180873 100644 --- a/pre_commit/clientlib/validate_base.py +++ b/pre_commit/clientlib/validate_base.py @@ -50,4 +50,4 @@ def get_validator( return obj - return validate \ No newline at end of file + return validate diff --git a/pre_commit/constants.py b/pre_commit/constants.py index b9df1995..dd4eed2c 100644 --- a/pre_commit/constants.py +++ b/pre_commit/constants.py @@ -9,4 +9,4 @@ SUPPORTED_LANGUAGES = set([ 'python', 'ruby', 'node', -]) \ No newline at end of file +]) diff --git a/pre_commit/hooks_workspace.py b/pre_commit/hooks_workspace.py index 6533c719..50c41d3e 100644 --- a/pre_commit/hooks_workspace.py +++ b/pre_commit/hooks_workspace.py @@ -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 \ No newline at end of file + yield diff --git a/pre_commit/languages/all.py b/pre_commit/languages/all.py index 033eee14..84f30771 100644 --- a/pre_commit/languages/all.py +++ b/pre_commit/languages/all.py @@ -21,4 +21,4 @@ languages = { 'node': node, 'python': python, 'ruby': ruby, -} \ No newline at end of file +} diff --git a/pre_commit/languages/ruby.py b/pre_commit/languages/ruby.py index 361ba13f..219f74d7 100644 --- a/pre_commit/languages/ruby.py +++ b/pre_commit/languages/ruby.py @@ -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) \ No newline at end of file + return helpers.run_hook(env, hook, file_args) diff --git a/tests/clientlib/validate_base_test.py b/tests/clientlib/validate_base_test.py index 22c59296..f900d4ae 100644 --- a/tests/clientlib/validate_base_test.py +++ b/tests/clientlib/validate_base_test.py @@ -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'] \ No newline at end of file + assert ret == ['foo', 'bar'] diff --git a/tests/clientlib/validate_manifest_test.py b/tests/clientlib/validate_manifest_test.py index e2b2c6a4..0246dfba 100644 --- a/tests/clientlib/validate_manifest_test.py +++ b/tests/clientlib/validate_manifest_test.py @@ -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 \ No newline at end of file + assert ret is expected diff --git a/tests/data/array_yaml_file.yaml b/tests/data/array_yaml_file.yaml index f97ce0d8..59121da8 100644 --- a/tests/data/array_yaml_file.yaml +++ b/tests/data/array_yaml_file.yaml @@ -1,2 +1,2 @@ - foo -- bar \ No newline at end of file +- bar diff --git a/tests/data/non_parseable_yaml_file.yaml b/tests/data/non_parseable_yaml_file.yaml index cdadb58f..ea185188 100644 --- a/tests/data/non_parseable_yaml_file.yaml +++ b/tests/data/non_parseable_yaml_file.yaml @@ -1 +1 @@ -foo: " \ No newline at end of file +foo: " diff --git a/tests/data/valid_yaml_but_invalid_manifest.yaml b/tests/data/valid_yaml_but_invalid_manifest.yaml index 7daacd5d..20e9ff3f 100644 --- a/tests/data/valid_yaml_but_invalid_manifest.yaml +++ b/tests/data/valid_yaml_but_invalid_manifest.yaml @@ -1 +1 @@ -foo: bar \ No newline at end of file +foo: bar diff --git a/tests/languages/all_test.py b/tests/languages/all_test.py index 6a17771a..3766a888 100644 --- a/tests/languages/all_test.py +++ b/tests/languages/all_test.py @@ -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') \ No newline at end of file + assert hasattr(languages[language], 'run_hook') diff --git a/tests/repository_test.py b/tests/repository_test.py index dadeb8af..d6125274 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -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']) - - -