From 6f20768384777e5ad18114de27ad0bf5ca40f162 Mon Sep 17 00:00:00 2001 From: Konstantin Martini Date: Thu, 10 Mar 2016 18:53:48 +0100 Subject: [PATCH] Changed '-' to '_' in check-config, so checks will be found. TODO: Find out if this breaks the config of these checks. --- .turnstile.yml | 4 ++-- turnstile/checks/__init__.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.turnstile.yml b/.turnstile.yml index c0fb214..62ec73a 100644 --- a/.turnstile.yml +++ b/.turnstile.yml @@ -1,8 +1,8 @@ checks: - specification - - branch-release + - branch_release - codevalidator - - protect-master + - protect_master specification: allowed_schemes: ['https'] allowed_formats: ['uri', 'github'] diff --git a/turnstile/checks/__init__.py b/turnstile/checks/__init__.py index d57fe32..29dca63 100644 --- a/turnstile/checks/__init__.py +++ b/turnstile/checks/__init__.py @@ -101,7 +101,10 @@ def run_checks(hook_name, user_configuration, repository_configuration, check_ob logger = output.get_sub_logger(hook_name.replace('_', '-'), 'run_checks') failed_checks = 0 checklist = repository_configuration.get('checks', []) - check_functions = get_checks(hook_name) + checklist = [x.replace('-', '_') for x in checklist] + logger.debug('Configured Checks: %s', checklist) + check_functions = list(get_checks(hook_name)) + logger.debug('Available Checks: %s', [f[0] for f in check_functions]) checks_to_run = (check for check_name, check in check_functions if check_name in checklist) for check in checks_to_run: