parameters: (build_folder, diff_branch, auto_fix)
docstring: Run clang-tidy on the diff between current and the diff_branch.
docstring_summary: Run clang-tidy on the diff between current and the diff_branch.
docstring_tokens: Run clang - tidy on the diff between current and the diff_branch .
function: def ClangTidyRunDiff(build_folder, diff_branch, auto_fix):
    """
    Run clang-tidy on the diff between current and the diff_branch.
    """
    if diff_branch is None:
      diff_branch = subprocess.check_output(['git', 'merge-base',
                                             'HEAD', 'origin/master']).strip()
  
    git_ps = subprocess.Popen(
      ['git', 'diff', '-U0', diff_branch], stdout=subprocess.PIPE)
  
    extra_args = []
    if auto_fix:
      extra_args.append('-fix')
  
    with open(os.devnull, 'w') as DEVNULL:
      """
      The script `clang-tidy-diff` does not provide support to add header-
      filters. To still analyze headers we use the build path option `-path` to
      inject our header-filter option. This works because the script just adds
      the passed path string to the commandline of clang-tidy.
      """
      modified_build_folder = build_folder
      modified_build_folder += ' -header-filter='
      modified_build_folder += '\'' + ''.join(HEADER_REGEX) + '\''
  
      ct_ps = subprocess.Popen(
        ['clang-tidy-diff.py', '-path', modified_build_folder, '-p1'] +
          extra_args,
        stdin=git_ps.stdout,
        stdout=subprocess.PIPE,
        stderr=DEVNULL)
    git_ps.wait()
    while True:
      line = ct_ps.stdout.readline()
      if line == '':
        break
  
      if skip_line(line):
        continue
  
      sys.stdout.write(line)
function_tokens: def ClangTidyRunDiff ( build_folder , diff_branch , auto_fix ) : if diff_branch is None : diff_branch = subprocess . check_output ( [ 'git' , 'merge-base' , 'HEAD' , 'origin/master' ] ) . strip ( ) git_ps = subprocess . Popen ( [ 'git' , 'diff' , '-U0' , diff_branch ] , stdout = subprocess . PIPE ) extra_args = [ ] if auto_fix : extra_args . append ( '-fix' ) with open ( os . devnull , 'w' ) as DEVNULL : """
      The script `clang-tidy-diff` does not provide support to add header-
      filters. To still analyze headers we use the build path option `-path` to
      inject our header-filter option. This works because the script just adds
      the passed path string to the commandline of clang-tidy.
      """ modified_build_folder = build_folder modified_build_folder += ' -header-filter=' modified_build_folder += '\'' + '' . join ( HEADER_REGEX ) + '\'' ct_ps = subprocess . Popen ( [ 'clang-tidy-diff.py' , '-path' , modified_build_folder , '-p1' ] + extra_args , stdin = git_ps . stdout , stdout = subprocess . PIPE , stderr = DEVNULL ) git_ps . wait ( ) while True : line = ct_ps . stdout . readline ( ) if line == '' : break if skip_line ( line ) : continue sys . stdout . write ( line )