Lines Matching full:hooks

16 """Unittests for the hooks module."""
33 import rh.hooks
71 """Verify builtin hooks are documented."""
72 data = self._grab_section('[Builtin Hooks]')
73 for hook in rh.hooks.BUILTIN_HOOKS:
80 for tool in rh.hooks.TOOL_PATHS:
87 for var in rh.hooks.Placeholders.vars():
101 self.replacer = rh.hooks.Placeholders(
207 @mock.patch.object(rh.hooks, '_get_build_os_name', return_value='vapier os')
218 scope = rh.hooks.ExclusionScope([])
223 scope = rh.hooks.ExclusionScope(['vendor/*', 'external/*'])
228 scope = rh.hooks.ExclusionScope(['^vendor/(?!google)',
238 @mock.patch.object(rh.hooks, '_get_build_os_name', return_value='vapier os')
243 self.assertEqual(args, rh.hooks.HookOptions.expand_vars(args))
248 self.assertEqual(exp_args, rh.hooks.HookOptions.expand_vars(args))
254 options = rh.hooks.HookOptions('hook name', args, {})
260 options = rh.hooks.HookOptions('hook name', [], {})
266 options = rh.hooks.HookOptions('hook name', [], {
284 ret = rh.hooks._run(['true'])
291 ret = rh.hooks._get_build_os_name()
298 ret = rh.hooks.get_helper_path('booga')
307 self.assertEqual(list(rh.hooks.TOOL_PATHS), sorted(rh.hooks.TOOL_PATHS))
315 list(rh.hooks.BUILTIN_HOOKS), sorted(rh.hooks.BUILTIN_HOOKS))
319 @mock.patch.object(rh.hooks, '_check_cmd', return_value=['check_cmd'])
321 """Verify the builtin hooks."""
325 self.options = rh.hooks.HookOptions('hook name', [], {})
328 """Helper for testing commit message hooks.
350 """Helper for testing hooks that filter by files and run external tools.
369 for hook in rh.hooks.BUILTIN_HOOKS:
381 ret = rh.hooks.check_aosp_license(
390 ret = rh.hooks.check_aosp_license(
400 ret = rh.hooks.check_aosp_license(
402 options=rh.hooks.HookOptions('hook name',
411 ret = rh.hooks.check_aosp_license(
413 options=rh.hooks.HookOptions('hook name', ['--exclude-dirs=b'], {})
421 ret = rh.hooks.check_bpfmt(
428 ret = rh.hooks.check_bpfmt(
436 ret = rh.hooks.check_checkpatch(
442 ret = rh.hooks.check_clang_format(
449 ret = rh.hooks.check_google_java_format(
457 ret = rh.hooks.check_google_java_format(
463 ret = rh.hooks.check_google_java_format(
465 options=rh.hooks.HookOptions('hook name',
473 rh.hooks.check_commit_msg_bug_field, True, (
481 rh.hooks.check_commit_msg_bug_field, False, (
494 rh.hooks.check_commit_msg_changeid_field, True, (
500 rh.hooks.check_commit_msg_changeid_field, False, (
510 rh.hooks.check_commit_msg_prebuilt_apk_fields,
520 rh.hooks.check_commit_msg_prebuilt_apk_fields,
562 rh.hooks.check_commit_msg_prebuilt_apk_fields,
616 rh.hooks.check_commit_msg_test_field, True, (
622 rh.hooks.check_commit_msg_test_field, False, (
632 rh.hooks.check_commit_msg_relnote_field_format,
709 rh.hooks.check_commit_msg_relnote_field_format,
770 rh.hooks.check_commit_msg_relnote_for_current_txt,
785 rh.hooks.check_commit_msg_relnote_for_current_txt,
800 rh.hooks.check_commit_msg_relnote_for_current_txt,
815 rh.hooks.check_commit_msg_relnote_for_current_txt,
832 rh.hooks.check_commit_msg_relnote_for_current_txt,
842 rh.hooks.check_commit_msg_relnote_for_current_txt,
852 rh.hooks.check_commit_msg_relnote_for_current_txt,
863 self._test_file_filter(mock_check, rh.hooks.check_cpplint,
869 ret = rh.hooks.check_gofmt(
876 ret = rh.hooks.check_gofmt(
883 ret = rh.hooks.check_json(
893 ret = rh.hooks.check_ktfmt(
901 ret = rh.hooks.check_ktfmt(
907 ret = rh.hooks.check_ktfmt(self.project, 'commit', 'desc', diff,
908 options=rh.hooks.HookOptions('hook name', [
914 self._test_file_filter(mock_check, rh.hooks.check_pylint2,
919 self._test_file_filter(mock_check, rh.hooks.check_pylint2,
924 self._test_file_filter(mock_check, rh.hooks.check_pylint3,
929 ret = rh.hooks.check_rustfmt(
936 ret = rh.hooks.check_rustfmt(
942 self._test_file_filter(mock_check, rh.hooks.check_xmllint,
948 ret = rh.hooks.check_android_test_mapping(
955 ret = rh.hooks.check_android_test_mapping(
962 ret = rh.hooks.check_aidl_format(
969 ret = rh.hooks.check_gofmt(