mirror of
https://github.com/AdaCore/git-hooks.git
synced 2026-02-12 12:43:11 -08:00
transition default style checker to style_checker
For NA17-007.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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/<module>/<path>' 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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user