def find_files_to_check(modified_files, repo_dir):
    if modified_files:
        changed_files = shell_utils.run_shell_command('git diff-index --diff-filter=ACMR --name-only HEAD')
        changed_files = '{}'.format(changed_files.decode('utf-8')).split()
        sources_to_check = [os.path.join(repo_dir, f) for f in changed_files if f.lower().endswith(tuple(SOURCE_EXTENSIONS))]
    else:
        sources_to_check = [os.path.join(d, f) for (d, dirs, files) in os.walk(repo_dir) for f in files if f.lower().endswith(tuple(SOURCE_EXTENSIONS))]
    return sources_to_check
def find_files_to_check(modified_files, repo_dir):
    if modified_files:
        changed_files = shell_utils.run_shell_command('git diff-index --diff-filter=ACMR --name-only HEAD')
        changed_files = '{}'.format(changed_files.decode('utf-8')).split()
        sources_to_check = [os.path.join(repo_dir, f) for f in changed_files if f.lower().endswith(tuple(SOURCE_EXTENSIONS))]
    else:
        sources_to_check = [os.path.join(d, f) for (d, dirs, files) in os.walk(repo_dir) for f in files if f.lower().endswith(tuple(SOURCE_EXTENSIONS))]
    return sources_to_check