def _CheckCppLint(_):
    logging.info('Checking cpplint...')
    utils.LoadSubmodule('third_party/styleguide/src')
    files = []
    for root, _, cur_files in os.walk(os.path.join(ROOT_DIR, 'shaka', 'src')):
        files += [
            os.path.join(root, f) for f in cur_files
            if f.endswith('.cc') or f.endswith('.h')
        ]

    lint = os.path.join(ROOT_DIR, 'third_party', 'styleguide', 'src',
                        'cpplint', 'cpplint.py')
    ignored_checks = [
        # cpplint doesn't calculate the correct header guard value.
        'build/header_guard',
        # We allow other C++11 headers.
        'build/c++11',
        # We use NOLINT directives that cpplint doesn't recognize.
        'readability/nolint',
        # We don't have owners on all our TODOs.
        'readability/todo',
    ]
    filter_ = '--filter=+,-' + ',-'.join(ignored_checks)
    # Filter out stdout so we only print the errors.
    with open(os.devnull, 'w') as f:
        return subprocess.call([lint, filter_] + files, stdout=f)
def GenDocs():
    """Generates the library documentation."""
    utils.LoadSubmodule('third_party/doxygen/src')
    if CompileDoxygen() != 0:
        return 1
    return subprocess.call([BIN_PATH], cwd=ROOT_DIR)