From fccb4e69350b8574ec34da5252b5f81da68e344b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 6 Nov 2017 18:14:59 -0800 Subject: [PATCH] Minor fixes --- pre_commit/main.py | 5 +---- tests/commands/autoupdate_test.py | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pre_commit/main.py b/pre_commit/main.py index fb5dd291..4c9202ad 100644 --- a/pre_commit/main.py +++ b/pre_commit/main.py @@ -168,10 +168,7 @@ def main(argv=None): ), ) autoupdate_parser.add_argument( - '--repo', nargs=1, default=None, - help=( - 'Repository to update the hooks of.' - ), + '--repo', help='Only update this repository.', ) migrate_config_parser = subparsers.add_parser( diff --git a/tests/commands/autoupdate_test.py b/tests/commands/autoupdate_test.py index e2618880..c78af1fb 100644 --- a/tests/commands/autoupdate_test.py +++ b/tests/commands/autoupdate_test.py @@ -123,6 +123,7 @@ def test_autoupdate_out_of_date_repo( assert 'exclude' not in after assert out_of_date_repo.head_sha in after + def test_autoupdate_out_of_date_repo_with_correct_repo_name( out_of_date_repo, in_tmpdir, mock_out_store_directory, ): @@ -139,10 +140,9 @@ def test_autoupdate_out_of_date_repo_with_correct_repo_name( after = open(C.CONFIG_FILE).read() assert ret == 0 assert before != after - # Make sure we don't add defaults - assert 'exclude' not in after assert out_of_date_repo.head_sha in after + def test_autoupdate_out_of_date_repo_with_wrong_repo_name( out_of_date_repo, in_tmpdir, mock_out_store_directory, ): @@ -160,6 +160,7 @@ def test_autoupdate_out_of_date_repo_with_wrong_repo_name( assert ret == 0 assert before == after + def test_does_not_reformat( out_of_date_repo, mock_out_store_directory, in_tmpdir, ):