Example #1
0
def main():
    ''' Main logic '''
    setup_working_dir()
    print 'Current working dir is {}'.format(os.getcwd())
    hooks_src_dir = os.path.join(os.getcwd(), 'tools', 'git-hooks')
    hooks_dst_dir = os.path.join(os.getcwd(), '.git', 'hooks')
    uninstall_hooks(hooks_dst_dir)
    install_hooks(hooks_src_dir, hooks_dst_dir)
Example #2
0
def main():
    ''' Main logic '''
    setup_working_dir()
    print 'Current working dir is {}'.format(os.getcwd())
    hooks_src_dir = os.path.join(
        os.getcwd(), 'tools', 'infrastructure', 'git-hooks')
    hooks_dst_dir = os.path.join(os.getcwd(), '.git', 'hooks')
    uninstall_hooks(hooks_dst_dir)
    install_hooks(hooks_src_dir, hooks_dst_dir)
Example #3
0
def main():
    ''' Main logic '''
    setup_working_dir()
    print 'Current working dir is {}'.format(os.getcwd())

    def action(file_path):
        if re.match('|'.join(INCLUDE_PATTERNS), file_path, re.M | re.I):
            if not re.match('|'.join(EXCLUDE_PATTERNS), file_path,
                            re.M | re.I):
                print 'Formatting file {}'.format(file_path)
                run_cmd(FORMAT_CMD.format(file_path))

    walk_dir('src', action)
Example #4
0
def main():
    ''' Main logic '''
    setup_working_dir()
    print 'Current working dir is {}'.format(os.getcwd())

    def action(file_path):
        if re.match('|'.join(INCLUDE_PATTERNS), file_path, re.M | re.I):
            if not re.match('|'.join(EXCLUDE_PATTERNS),
                            file_path,
                            re.M | re.I):
                print 'Formatting file {}'.format(file_path)
                run_cmd(FORMAT_CMD.format(file_path))
    walk_dir('src', action)