EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eicpy.cpplint Namespace Reference

Classes

class  CleansedLines
 

Functions

def FindNextMultiLineCommentStart
 
def FindNextMultiLineCommentEnd
 
def RemoveMultiLineCommentsFromRange
 
def RemoveMultiLineComments
 
def CleanseComments
 
def FindEndOfExpressionInLine
 
def CloseExpression
 
def CheckForCopyright
 
def GetHeaderGuardCPPVariable
 
def CheckForHeaderGuard
 
def CheckForUnicodeReplacementCharacters
 
def CheckForNewlineAtEOF
 
def CheckForMultilineCommentsAndStrings
 

Variables

string _USAGE
 
list _ERROR_CATEGORIES
 
list _DEFAULT_FILTERS ['-build/include_alpha']
 
tuple _STL_HEADERS
 
tuple _CPP_HEADERS
 
list _CHECK_MACROS
 
tuple _CHECK_REPLACEMENT dict([(m, {}) for m in _CHECK_MACROS])
 
dictionary _ALT_TOKEN_REPLACEMENT
 
tuple _ALT_TOKEN_REPLACEMENT_PATTERN
 

Function Documentation

def eicpy.cpplint.CheckForCopyright (   filename,
  lines,
  error 
)
Logs an error if no Copyright message appears at the top of the file.

Definition at line 1100 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1100 of file cpplint.py

References min, and charm_jet_strange_helicity.xrange.

def eicpy.cpplint.CheckForHeaderGuard (   filename,
  lines,
  error 
)
Checks that the file contains a header guard.

Logs an error if no #ifndef header guard is present.  For other
headers, checks that the full pathname is used.

Args:
  filename: The name of the C++ header file.
  lines: An array of strings, each representing a line of the file.
  error: The function to call with any errors found.

Definition at line 1137 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1137 of file cpplint.py

References eicpy.cpplint.GetHeaderGuardCPPVariable().

+ Here is the call graph for this function:

def eicpy.cpplint.CheckForMultilineCommentsAndStrings (   filename,
  clean_lines,
  linenum,
  error 
)
Logs an error if we see /* ... */ or "..." that extend past one line.

/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other.  Likewise, it's ok for strings to extend across multiple
lines, as long as a line continuation character (backslash)
terminates each line. Although not currently prohibited by the C++
style guide, it's ugly and unnecessary. We don't do well with either
in this lint program, so we warn about both.

Args:
  filename: The name of the current file.
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  error: The function to call with any errors found.

Definition at line 1249 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1249 of file cpplint.py

def eicpy.cpplint.CheckForNewlineAtEOF (   filename,
  lines,
  error 
)
Logs an error if there is no newline char at the end of the file.

Args:
  filename: The name of the current file.
  lines: An array of strings, each representing a line of the file.
  error: The function to call with any errors found.

Definition at line 1231 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1231 of file cpplint.py

def eicpy.cpplint.CheckForUnicodeReplacementCharacters (   filename,
  lines,
  error 
)
Logs an error for each line containing Unicode replacement characters.

These indicate that either the file contained invalid UTF-8 (likely)
or Unicode replacement characters (which it shouldn't).  Note that
it's possible for this to throw off line numbering if the invalid
UTF-8 occurred adjacent to a newline.

Args:
  filename: The name of the current file.
  lines: An array of strings, each representing a line of the file.
  error: The function to call with any errors found.

Definition at line 1212 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1212 of file cpplint.py

def eicpy.cpplint.CleanseComments (   line)
Removes //-comments and single-line C-style /* */ comments.

Args:
  line: A line of C++ source.

Returns:
  The line with single-line comments removed.

Definition at line 972 of file cpplint.py.

View newest version in sPHENIX GitHub at line 972 of file cpplint.py

def eicpy.cpplint.CloseExpression (   clean_lines,
  linenum,
  pos 
)
If input points to ( or { or [, finds the position that closes it.

If lines[linenum][pos] points to a '(' or '{' or '[', finds the
linenum/pos that correspond to the closing of the expression.

Args:
  clean_lines: A CleansedLines instance containing the file.
  linenum: The number of the line to check.
  pos: A position on the line.

Returns:
  A tuple (line, linenum, pos) pointer *past* the closing brace, or
  (line, len(lines), -1) if we never find a close.  Note we ignore
  strings and comments when matching; and the line we return is the
  'cleansed' line at linenum.

Definition at line 1056 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1056 of file cpplint.py

References eicpy.cpplint.FindEndOfExpressionInLine().

+ Here is the call graph for this function:

def eicpy.cpplint.FindEndOfExpressionInLine (   line,
  startpos,
  depth,
  startchar,
  endchar 
)
Find the position just after the matching endchar.

Args:
  line: a CleansedLines line.
  startpos: start searching at this position.
  depth: nesting level at startpos.
  startchar: expression opening character.
  endchar: expression closing character.

Returns:
  Index just after endchar.

Definition at line 1033 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1033 of file cpplint.py

References charm_jet_strange_helicity.xrange.

Referenced by eicpy.cpplint.CloseExpression().

+ Here is the caller graph for this function:

def eicpy.cpplint.FindNextMultiLineCommentEnd (   lines,
  lineix 
)
We are inside a comment, find the end marker.

Definition at line 939 of file cpplint.py.

View newest version in sPHENIX GitHub at line 939 of file cpplint.py

Referenced by eicpy.cpplint.RemoveMultiLineComments().

+ Here is the caller graph for this function:

def eicpy.cpplint.FindNextMultiLineCommentStart (   lines,
  lineix 
)
Find the beginning marker for a multiline comment.

Definition at line 928 of file cpplint.py.

View newest version in sPHENIX GitHub at line 928 of file cpplint.py

Referenced by eicpy.cpplint.RemoveMultiLineComments().

+ Here is the caller graph for this function:

def eicpy.cpplint.GetHeaderGuardCPPVariable (   filename)
Returns the CPP variable that should be used as a header guard.

Args:
  filename: The name of a C++ header file.

Returns:
  The CPP variable that should be used as a header guard in the
  named file.

Definition at line 1113 of file cpplint.py.

View newest version in sPHENIX GitHub at line 1113 of file cpplint.py

Referenced by eicpy.cpplint.CheckForHeaderGuard().

+ Here is the caller graph for this function:

def eicpy.cpplint.RemoveMultiLineComments (   filename,
  lines,
  error 
)
Removes multiline (c-style) comments from lines.

Definition at line 956 of file cpplint.py.

View newest version in sPHENIX GitHub at line 956 of file cpplint.py

References eicpy.cpplint.FindNextMultiLineCommentEnd(), eicpy.cpplint.FindNextMultiLineCommentStart(), and eicpy.cpplint.RemoveMultiLineCommentsFromRange().

+ Here is the call graph for this function:

def eicpy.cpplint.RemoveMultiLineCommentsFromRange (   lines,
  begin,
  end 
)
Clears a range of lines for multi-line comments.

Definition at line 948 of file cpplint.py.

View newest version in sPHENIX GitHub at line 948 of file cpplint.py

Referenced by eicpy.cpplint.RemoveMultiLineComments().

+ Here is the caller graph for this function:

Variable Documentation

dictionary eicpy.cpplint._ALT_TOKEN_REPLACEMENT
Initial value:
1 {
2  'and': '&&',
3  'bitor': '|',
4  'or': '||',
5  'xor': '^',
6  'compl': '~',
7  'bitand': '&',
8  'and_eq': '&=',
9  'or_eq': '|=',
10  'xor_eq': '^=',
11  'not': '!',
12  'not_eq': '!='
13  }

Definition at line 305 of file cpplint.py.

View newest version in sPHENIX GitHub at line 305 of file cpplint.py

tuple eicpy.cpplint._ALT_TOKEN_REPLACEMENT_PATTERN

Definition at line 325 of file cpplint.py.

View newest version in sPHENIX GitHub at line 325 of file cpplint.py

list eicpy.cpplint._CHECK_MACROS
Initial value:
1 [
2  'DCHECK', 'CHECK',
3  'EXPECT_TRUE_M', 'EXPECT_TRUE',
4  'ASSERT_TRUE_M', 'ASSERT_TRUE',
5  'EXPECT_FALSE_M', 'EXPECT_FALSE',
6  'ASSERT_FALSE_M', 'ASSERT_FALSE',
7  ]

Definition at line 271 of file cpplint.py.

View newest version in sPHENIX GitHub at line 271 of file cpplint.py

tuple eicpy.cpplint._CHECK_REPLACEMENT dict([(m, {}) for m in _CHECK_MACROS])

Definition at line 280 of file cpplint.py.

View newest version in sPHENIX GitHub at line 280 of file cpplint.py

tuple eicpy.cpplint._CPP_HEADERS
Initial value:
1 frozenset([
2  'algo.h', 'builtinbuf.h', 'bvector.h', 'cassert', 'cctype',
3  'cerrno', 'cfloat', 'ciso646', 'climits', 'clocale', 'cmath',
4  'complex', 'complex.h', 'csetjmp', 'csignal', 'cstdarg', 'cstddef',
5  'cstdio', 'cstdlib', 'cstring', 'ctime', 'cwchar', 'cwctype',
6  'defalloc.h', 'deque.h', 'editbuf.h', 'exception', 'fstream',
7  'fstream.h', 'hashtable.h', 'heap.h', 'indstream.h', 'iomanip',
8  'iomanip.h', 'ios', 'iosfwd', 'iostream', 'iostream.h', 'istream',
9  'istream.h', 'iterator.h', 'limits', 'map.h', 'multimap.h', 'multiset.h',
10  'numeric', 'ostream', 'ostream.h', 'parsestream.h', 'pfstream.h',
11  'PlotFile.h', 'procbuf.h', 'pthread_alloc.h', 'rope', 'rope.h',
12  'ropeimpl.h', 'SFile.h', 'slist', 'slist.h', 'stack.h', 'stdexcept',
13  'stdiostream.h', 'streambuf', 'streambuf.h', 'stream.h', 'strfile.h',
14  'string', 'strstream', 'strstream.h', 'tempbuf.h', 'tree.h', 'typeinfo',
15  'valarray',
16  ])

Definition at line 250 of file cpplint.py.

View newest version in sPHENIX GitHub at line 250 of file cpplint.py

list eicpy.cpplint._DEFAULT_FILTERS ['-build/include_alpha']

Definition at line 232 of file cpplint.py.

View newest version in sPHENIX GitHub at line 232 of file cpplint.py

list eicpy.cpplint._ERROR_CATEGORIES

Definition at line 164 of file cpplint.py.

View newest version in sPHENIX GitHub at line 164 of file cpplint.py

tuple eicpy.cpplint._STL_HEADERS
Initial value:
1 frozenset([
2  'algobase.h', 'algorithm', 'alloc.h', 'bitset', 'deque', 'exception',
3  'function.h', 'functional', 'hash_map', 'hash_map.h', 'hash_set',
4  'hash_set.h', 'iterator', 'list', 'list.h', 'map', 'memory', 'new',
5  'pair.h', 'pthread_alloc', 'queue', 'set', 'set.h', 'sstream', 'stack',
6  'stl_alloc.h', 'stl_relops.h', 'type_traits.h',
7  'utility', 'vector', 'vector.h',
8  ])

Definition at line 239 of file cpplint.py.

View newest version in sPHENIX GitHub at line 239 of file cpplint.py

string eicpy.cpplint._USAGE

Definition at line 92 of file cpplint.py.

View newest version in sPHENIX GitHub at line 92 of file cpplint.py