parameters: (build_folder)
docstring: Generate a compilation database.
  
    Currently clang-tidy-4 does not understand all flags that are passed
    by the build system, therefore, we remove them from the generated file.
docstring_summary: Generate a compilation database.
docstring_tokens: Generate a compilation database .
function: def GenerateCompileCommands(build_folder):
    """
    Generate a compilation database.
  
    Currently clang-tidy-4 does not understand all flags that are passed
    by the build system, therefore, we remove them from the generated file.
    """
    ninja_ps = subprocess.Popen(
      ['ninja', '-t', 'compdb', 'cxx', 'cc'],
      stdout=subprocess.PIPE,
      cwd=build_folder)
  
    out_filepath = os.path.join(build_folder, 'compile_commands.json')
    with open(out_filepath, 'w') as cc_file:
      while True:
          line = ninja_ps.stdout.readline()
  
          if line == '':
              break
  
          line = line.replace('-fcomplete-member-pointers', '')
          line = line.replace('-Wno-enum-compare-switch', '')
          line = line.replace('-Wno-ignored-pragma-optimize', '')
          line = line.replace('-Wno-null-pointer-arithmetic', '')
          line = line.replace('-Wno-unused-lambda-capture', '')
          line = line.replace('-Wno-defaulted-function-deleted', '')
          cc_file.write(line)
function_tokens: def GenerateCompileCommands ( build_folder ) : ninja_ps = subprocess . Popen ( [ 'ninja' , '-t' , 'compdb' , 'cxx' , 'cc' ] , stdout = subprocess . PIPE , cwd = build_folder ) out_filepath = os . path . join ( build_folder , 'compile_commands.json' ) with open ( out_filepath , 'w' ) as cc_file : while True : line = ninja_ps . stdout . readline ( ) if line == '' : break line = line . replace ( '-fcomplete-member-pointers' , '' ) line = line . replace ( '-Wno-enum-compare-switch' , '' ) line = line . replace ( '-Wno-ignored-pragma-optimize' , '' ) line = line . replace ( '-Wno-null-pointer-arithmetic' , '' ) line = line . replace ( '-Wno-unused-lambda-capture' , '' ) line = line . replace ( '-Wno-defaulted-function-deleted' , '' ) cc_file . write ( line )