~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/cpplint.py

  • Committer: Monty Taylor
  • Date: 2009-10-15 18:16:17 UTC
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20091015181617-zeh877f3mx7c7sbd
Added two more checks from cpplint. Added BSD license header for crc files. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
2082
2082
    include_state: An _IncludeState instance in which the headers are inserted.
2083
2083
    error: The function to call with any errors found.
2084
2084
  """
2085
 
  if not (filename.endswith("config.h") or filename.endswith("global.h") or filename.endswith("server_includes.h")):
2086
 
 
2087
 
    fileinfo = FileInfo(filename)
2088
 
 
2089
 
    line = clean_lines.lines[linenum]
2090
 
 
2091
 
    match = _RE_PATTERN_INCLUDE.search(line)
2092
 
    if match:
2093
 
      include = match.group(2)
2094
 
      if Match(r'(config|global|server_includes|_priv)\.h$', include):
2095
 
        error(filename, linenum, 'build/include_config', 4,
2096
 
              'Do not include config.h or files that include config.h in .h files')
 
2085
  if filename.endswith("config.h") or filename.endswith("global.h") or filename.endswith("server_includes.h") or filename.endswith("_priv.h") or not filename.endswith(".h"):
 
2086
    return
 
2087
 
 
2088
  fileinfo = FileInfo(filename)
 
2089
 
 
2090
  line = clean_lines.lines[linenum]
 
2091
 
 
2092
  match = _RE_PATTERN_INCLUDE.search(line)
 
2093
  if match:
 
2094
    include = match.group(2)
 
2095
    if Match(r'(config|global|server_includes|_priv)\.h$', include):
 
2096
      error(filename, linenum, 'build/include_config', 4,
 
2097
            'Do not include config.h or files that include config.h in .h files')
2097
2098
      
2098
2099
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
2099
2100
  """Check rules that are applicable to #include lines.