コード例 #1
0
def run():
    failures = list(itertools.chain(*map(check_whitespace, paths())))

    if len(failures) == 0:
        return Success("No trailing whitespace found")
    else:
        output = '\n'.join([display_failure(failure) for failure in failures])
        return Failure("Trailing whitespace found on files and lines:", output)
コード例 #2
0
ファイル: shebang.py プロジェクト: larsbergstrom/saltfs
def run():
    executables = filter(is_executable, paths())
    failures = list(filter(lambda e: not has_correct_header(e), executables))

    if len(failures) != 0:
        output = '\n'.join([display_path(path) for path in failures])
        return Failure("Bad shebangs found in these files:", output)

    return Success("All executable shebangs are correct")
コード例 #3
0
ファイル: shebang.py プロジェクト: rwaweber/saltfs
def run():
    executables = filter(is_executable, paths())
    failures = list(filter(lambda e: not has_correct_header(e), executables))

    if len(failures) == 0:
        return Success("All executable shebangs are correct")
    else:
        output = '\n'.join([display_path(path) for path in failures])
        return Failure("Bad shebangs found in these files:", output)