コード例 #1
0
def command_check_ts(tsfiles=None):

    # Run the basic reference checks by building the jslib
    if 0 != command_jslib(['--refcheck']):
        return 1

    # Run tslint on all the typescript source
    if TURBULENZOS == 'win32':
        tslint = 'tslint.cmd -c .tslintrc -f '
    else:
        tslint = 'tslint -c .tslintrc -f '
    tsfiles = tsfiles or ['tslib/*.ts']

    files = []
    for pattern in tsfiles:
        for f in iglob(pattern):
            files.append(f)

    for f in files:
        try:
            sh('%s %s' % (tslint, f), verbose=False)
            ok(f)
        except CalledProcessError as e:
            warning(f)
            echo(e.output)

    return 0
コード例 #2
0
ファイル: manage.py プロジェクト: MdFarooq/turbulenz_engine
def command_check_docs():
    # clean the docs first to get all warnings
    command_docs_clean()

    build_fail_regex = re.compile('^.*ERROR.*$|^.*WARNING.*$|^.*SEVERE.*$|^.*Exception occurred.*$', re.MULTILINE)
    result = 0

    cmd = _docs_build_command()
    log(cmd)
    stdout = sh(cmd, wait=True, verbose=False)
    errors = re.findall(build_fail_regex, stdout)
    if len(errors) > 0:
        for e in errors:
            error(e)
        result += 1
        error('Build failed. Documentation contains errors or warnings.')

    if result == 0:
        ok('HTML build')
        print 'Checking links'
        result += check_documentation_links('build/docs')
        if result == 0:
            ok('docs links')

    if result == 0:
        ok('Documentation build succeeded')
    else:
        error('Documentation build failed')
    return result
コード例 #3
0
def command_check_docs():
    # clean the docs first to get all warnings
    command_docs_clean()

    build_fail_regex = re.compile('^.*ERROR.*$|^.*WARNING.*$|^.*SEVERE.*$|^.*Exception occurred.*$', re.MULTILINE)
    result = 0

    cmd = _docs_build_command()
    log(cmd)
    stdout = sh(cmd, wait=True, verbose=False)
    errors = re.findall(build_fail_regex, stdout)
    if len(errors) > 0:
        for e in errors:
            error(e)
        result += 1
        error('Build failed. Documentation contains errors or warnings.')

    if result == 0:
        ok('HTML build')
        print 'Checking links'
        result += check_documentation_links('build/docs')
        if result == 0:
            ok('docs links')

    if result == 0:
        ok('Documentation build succeeded')
    else:
        error('Documentation build failed')
    return result
コード例 #4
0
ファイル: manage.py プロジェクト: MdFarooq/turbulenz_engine
def command_check_py(pyfiles=None):
    def module_glob(pattern):
        if '*' in pattern or '/' in pattern:
            return iglob(pattern)
        else:
            return [pattern]

    pylint = 'python -m pylint.lint --rcfile=.pylintrc -f text -r n'
    pyfiles = pyfiles or ['*.py', 'scripts/*.py']

    files = []
    for pattern in pyfiles:
        for p in module_glob(pattern):
            files.append(p)

    for f in files:
        try:
            sh('%s %s' % (pylint, f), verbose=False)
            ok(f)
        except CalledProcessError as e:
            warning(f)
            echo(e.output)
コード例 #5
0
def command_check_py(pyfiles=None):
    def module_glob(pattern):
        if '*' in pattern or '/' in pattern:
            return iglob(pattern)
        else:
            return [pattern]

    pylint = 'python -m pylint.lint --rcfile=.pylintrc -f text -r n'
    pyfiles = pyfiles or ['*.py', 'scripts/*.py']

    files = []
    for pattern in pyfiles:
        for p in module_glob(pattern):
            files.append(p)

    for f in files:
        try:
            sh('%s %s' % (pylint, f), verbose=False)
            ok(f)
        except CalledProcessError as e:
            warning(f)
            echo(e.output)