Skip to content
  • thakis's avatar
    Add missing .h files to .gn files that have a .cc file next to it in the gn file already. · b8590c94
    thakis authored
    I downloaded https://docs.google.com/spreadsheets/d/15az3FMl-jAS0mx4E9XVSBVHVpmEzo-9EAGY0ywe7bZs/edit#gid=0
    as a csv file, and removed the header line and all columns except the filename.
    Then i ran this script to create this CL:
    
        import os, re, subprocess
        edits = {}
        for filename in open('/Users/thakis/Downloads/files.txt'):
          filename = filename.strip()
          if not filename.endswith('.h'):
    	continue
          basename = os.path.basename(filename)
          cc = r'\b' + os.path.splitext(basename)[0] + r'\.(cc|cpp|mm)\b'
          p = subprocess.Popen(['git', 'grep', '-En', cc, '--', '*.gn', '*.gni'],
    			   stdout = subprocess.PIPE)
          out, _ = p.communicate()
          if p.returncode != 0 or not out:
    	continue
    
          for gnline in out.splitlines():
    	gnfile, linenr, contents = gnline.split(':')
    	linenr = int(linenr)
    	new = re.sub(cc, basename, contents)
    	print gnfile, linenr, new
    	edits.setdefault(gnfile, {})[lin...
    b8590c94