chrome/browser/resources/chromeos/semantic_css_checker.py
def RunChecks(input_api, output_api):
    """Runs check for any non-semantic CSS colors used.

    Checks if the affected lines of code in input_api use non-semantic CSS
    colors, and if so, returns a list containing the warnings that should
    be displayed for each violation.

    Args:
        input_api: presubmit.InputApi containing information of the files
          in the change.
        output_api: presubmit.OutputApi used to display the warnings.

    Returns:
        A list of presubmit warnings, each containing the line the violation
        occurred and the warning message.
    """
    results = []
    for f in input_api.AffectedFiles():
        exts = ['html', 'css']
        if not any(f.LocalPath().endswith(ext) for ext in exts):
            continue

        for line_num, line in f.ChangedContents():
          for pattern in _NON_SEMANTIC_CSS_COLOR_PATTERNS:
            if pattern in line:
              results.append(output_api.PresubmitPromptWarning(
                "%s:%d:\n\n    %s\n\n"
                "Use of non-semantic color in CSS. Please make sure that all "
                "colors in\nCSS use semantic values defined in "
                "ui/chromeos/styles/cros_colors.json5\ninstead of constant "
                "color values." %
                (f.LocalPath(), line_num, line.strip())))
              break
    return results
Runs check for any non-semantic CSS colors used.

    Checks if the affected lines of code in input_api use non-semantic CSS
    colors, and if so, returns a list containing the warnings that should
    be displayed for each violation.

    Args:
        input_api: presubmit.InputApi containing information of the files
          in the change.
        output_api: presubmit.OutputApi used to display the warnings.

    Returns:
        A list of presubmit warnings, each containing the line the violation
        occurred and the warning message.
    
Runs check for any non-semantic CSS colors used.
Checks if the affected lines of code in input_api use non-semantic CSS
colors, and if so, returns a list containing the warnings that should
be displayed for each violation.
Runs check for any non - semantic CSS colors used . Checks if the affected lines of code in input_api use non - semantic CSS colors and if so returns a list containing the warnings that should be displayed for each violation .
def RunChecks(input_api, output_api):
    results = []
    for f in input_api.AffectedFiles():
        exts = ['html', 'css']
        if not any(f.LocalPath().endswith(ext) for ext in exts):
            continue
        for line_num, line in f.ChangedContents():
          for pattern in _NON_SEMANTIC_CSS_COLOR_PATTERNS:
            if pattern in line:
              results.append(output_api.PresubmitPromptWarning(
                "%s:%d:\n\n    %s\n\n"
                "Use of non-semantic color in CSS. Please make sure that all "
                "colors in\nCSS use semantic values defined in "
                "ui/chromeos/styles/cros_colors.json5\ninstead of constant "
                "color values." %
                (f.LocalPath(), line_num, line.strip())))
              break
    return results
def RunChecks ( input_api , output_api ) : results = [ ] for f in input_api . AffectedFiles ( ) : exts = [ 'html' , 'css' ] if not any ( f . LocalPath ( ) . endswith ( ext ) for ext in exts ) : continue for line_num , line in f . ChangedContents ( ) : for pattern in _NON_SEMANTIC_CSS_COLOR_PATTERNS : if pattern in line : results . append ( output_api . PresubmitPromptWarning ( "%s:%d:\n\n    %s\n\n" "Use of non-semantic color in CSS. Please make sure that all " "colors in\nCSS use semantic values defined in " "ui/chromeos/styles/cros_colors.json5\ninstead of constant " "color values." % ( f . LocalPath ( ) , line_num , line . strip ( ) ) ) ) break return results
Runs check for any non-semantic CSS colors used.
Runs check for any non - semantic CSS colors used .
"""Runs check for any non-semantic CSS colors used.

    Checks if the affected lines of code in input_api use non-semantic CSS
    colors, and if so, returns a list containing the warnings that should
    be displayed for each violation.

    Args:
        input_api: presubmit.InputApi containing information of the files
          in the change.
        output_api: presubmit.OutputApi used to display the warnings.

    Returns:
        A list of presubmit warnings, each containing the line the violation
        occurred and the warning message.
    """
A list of presubmit warnings, each containing the line the violation
occurred and the warning message.
A list of presubmit warnings each containing the line the violation occurred and the warning message .
input_api
presubmit.InputApi containing information of the files
in the change.
presubmit . InputApi containing information of the files in the change .
output_api
presubmit.OutputApi used to display the warnings.
presubmit . OutputApi used to display the warnings .