From 168de73a97c951fdbf126d4e09f8df25c3140eaa Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 18 May 2017 05:33:16 -0700 Subject: [PATCH] transition default style checker to style_checker For NA17-007. --- hooks/config.py | 2 +- hooks/pre_commit_checks.py | 8 +++----- hooks/syslog.py | 2 +- .../{cvs_check => style_checker} | 0 .../tests/LC27-002__nocvscheck_user_override/test.py | 2 +- testsuite/tests/LC27-012__logger_error/test.py | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) rename testsuite/tests/L614-037__push_submodule_creation/{cvs_check => style_checker} (100%) diff --git a/hooks/config.py b/hooks/config.py index dc596af..aa95a05 100644 --- a/hooks/config.py +++ b/hooks/config.py @@ -46,7 +46,7 @@ GIT_CONFIG_OPTS = \ 'hooks.no-rh-style-checks': {'default': '', 'type': tuple}, 'hooks.post-receive-hook': {'default': None}, 'hooks.reject-merge-commits': {'default': '', 'type': tuple}, - 'hooks.style-checker': {'default': 'cvs_check'}, + 'hooks.style-checker': {'default': 'style_checker'}, 'hooks.tn-required': {'default': False, 'type': bool}, # The following options are for testing purposes only, and should diff --git a/hooks/pre_commit_checks.py b/hooks/pre_commit_checks.py index f2acef2..258089d 100644 --- a/hooks/pre_commit_checks.py +++ b/hooks/pre_commit_checks.py @@ -61,11 +61,9 @@ def check_file(filename, sha1, commit_rev, project_name): else: style_checker = git_config('hooks.style-checker') - # ??? It appears that cvs_check, the official style-checker, - # requires the SVN path of the file to be checked as the first - # argument. Not sure why, but that does not really apply in - # our context. Use `trunk//' to work around - # the issue. + # ??? We are calling the style_checker using the legacy + # cvs_checker-style SVN-like path which is no longer necessary. + # We should be able to just pass the module name, now. style_checker_args = ['trunk/%s/%s' % (project_name, filename), filename] diff --git a/hooks/syslog.py b/hooks/syslog.py index e9a5d80..9fd16d2 100644 --- a/hooks/syslog.py +++ b/hooks/syslog.py @@ -7,7 +7,7 @@ from subprocess import Popen, PIPE, STDOUT from utils import warn -def syslog(message, tag='cvs_check', priority='local0.warn'): +def syslog(message, tag='style_checker', priority='local0.warn'): """Add the given entry to the syslog file. PARAMETERS diff --git a/testsuite/tests/L614-037__push_submodule_creation/cvs_check b/testsuite/tests/L614-037__push_submodule_creation/style_checker similarity index 100% rename from testsuite/tests/L614-037__push_submodule_creation/cvs_check rename to testsuite/tests/L614-037__push_submodule_creation/style_checker diff --git a/testsuite/tests/LC27-002__nocvscheck_user_override/test.py b/testsuite/tests/LC27-002__nocvscheck_user_override/test.py index 39fb457..5f3d3bb 100644 --- a/testsuite/tests/LC27-002__nocvscheck_user_override/test.py +++ b/testsuite/tests/LC27-002__nocvscheck_user_override/test.py @@ -54,7 +54,7 @@ error: failed to push some refs to '../bare/repo.git' remote: DEBUG: validate_ref_update (refs/heads/master, d065089ff184d97934c010ccd0e7e8ed94cb7165, a60540361d47901d3fe254271779f380d94645f7) remote: DEBUG: update base: d065089ff184d97934c010ccd0e7e8ed94cb7165 remote: DEBUG: %(TEST_DIR)s/.no_cvs_check found - pre-commit checks disabled -remote: SYSLOG: cvs_check: Pre-commit checks disabled for a60540361d47901d3fe254271779f380d94645f7 on repo by user testsuite using %(TEST_DIR)s/.no_cvs_check +remote: SYSLOG: style_checker: Pre-commit checks disabled for a60540361d47901d3fe254271779f380d94645f7 on repo by user testsuite using %(TEST_DIR)s/.no_cvs_check remote: DEBUG: post_receive_one(ref_name=refs/heads/master remote: old_rev=d065089ff184d97934c010ccd0e7e8ed94cb7165 remote: new_rev=a60540361d47901d3fe254271779f380d94645f7) diff --git a/testsuite/tests/LC27-012__logger_error/test.py b/testsuite/tests/LC27-012__logger_error/test.py index 55df4ff..03bee01 100644 --- a/testsuite/tests/LC27-012__logger_error/test.py +++ b/testsuite/tests/LC27-012__logger_error/test.py @@ -26,7 +26,7 @@ class TestRun(TestCase): expected_out = """\ remote: *** Failed to file the following syslog entry: remote: *** - message: Pre-commit checks disabled for a60540361d47901d3fe254271779f380d94645f7 on repo by user testsuite using %(TEST_DIR)s/.no_cvs_check -remote: *** - tag: cvs_check +remote: *** - tag: style_checker remote: *** - priority: local0.warn remote: *** remote: *** logger returned with error code 1: