third_party/blink/tools/blinkpy/style/checkers/cpp.py
def check_check(clean_lines, line_number, error):
    """Checks the use of CHECK and EXPECT macros.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      line_number: The number of the line to check.
      error: The function to call with any errors found.
    """

    # Decide the set of replacement macros that should be suggested
    raw_lines = clean_lines.raw_lines
    current_macro = ''
    for macro in _CHECK_MACROS:
        if raw_lines[line_number].find(macro) >= 0:
            current_macro = macro
            break
    if not current_macro:
        # Don't waste time here if line doesn't contain 'CHECK' or 'EXPECT'
        return

    line = clean_lines.elided[line_number]  # get rid of comments and strings

    # Encourage replacing plain CHECKs with CHECK_EQ/CHECK_NE/etc.
    for operator in ['==', '!=', '>=', '>', '<=', '<']:
        if replaceable_check(operator, current_macro, line):
            error(
                line_number, 'readability/check', 2,
                'Consider using %s(a, b) instead of %s(a %s b)' %
                (_CHECK_REPLACEMENT[current_macro][operator], current_macro,
                 operator))
            break
Checks the use of CHECK and EXPECT macros.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      line_number: The number of the line to check.
      error: The function to call with any errors found.
    
Checks the use of CHECK and EXPECT macros.
Checks the use of CHECK and EXPECT macros .
def check_check(clean_lines, line_number, error):
    raw_lines = clean_lines.raw_lines
    current_macro = ''
    for macro in _CHECK_MACROS:
        if raw_lines[line_number].find(macro) >= 0:
            current_macro = macro
            break
    if not current_macro:
        return
    line = clean_lines.elided[line_number]  
    for operator in ['==', '!=', '>=', '>', '<=', '<']:
        if replaceable_check(operator, current_macro, line):
            error(
                line_number, 'readability/check', 2,
                'Consider using %s(a, b) instead of %s(a %s b)' %
                (_CHECK_REPLACEMENT[current_macro][operator], current_macro,
                 operator))
            break
def check_check ( clean_lines , line_number , error ) : raw_lines = clean_lines . raw_lines current_macro = '' for macro in _CHECK_MACROS : if raw_lines [ line_number ] . find ( macro ) >= 0 : current_macro = macro break if not current_macro : return line = clean_lines . elided [ line_number ] for operator in [ '==' , '!=' , '>=' , '>' , '<=' , '<' ] : if replaceable_check ( operator , current_macro , line ) : error ( line_number , 'readability/check' , 2 , 'Consider using %s(a, b) instead of %s(a %s b)' % ( _CHECK_REPLACEMENT [ current_macro ] [ operator ] , current_macro , operator ) ) break
Checks the use of CHECK and EXPECT macros.
Checks the use of CHECK and EXPECT macros .
"""Checks the use of CHECK and EXPECT macros.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      line_number: The number of the line to check.
      error: The function to call with any errors found.
    """ # Decide the set of replacement macros that should be suggested # Don't waste time here if line doesn't contain 'CHECK' or 'EXPECT' # get rid of comments and strings # Encourage replacing plain CHECKs with CHECK_EQ/CHECK_NE/etc.
clean_lines
A CleansedLines instance containing the file.
A CleansedLines instance containing the file .
line_number
The number of the line to check.
The number of the line to check .
error
The function to call with any errors found.
The function to call with any errors found .