tools/web_dev_style/html_checker.py
def RunChecks(self):
    """Check for violations of the Chromium web development style guide. See
       https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md
    """
    results = []

    affected_files = self.input_api.AffectedFiles(file_filter=self.file_filter,
                                                  include_deletes=False)

    for f in affected_files:
      if not f.LocalPath().endswith('.html'):
        continue

      errors = []

      for line_number, line in f.ChangedContents():
        errors.extend([
            _f for _f in [
                self.ClassesUseDashFormCheck(line_number, line),
                self.DoNotCloseSingleTagsCheck(line_number, line),
                self.DoNotUseBrElementCheck(line_number, line),
                self.DoNotUseInputTypeButtonCheck(line_number, line),
                self.I18nContentJavaScriptCaseCheck(line_number, line),
                self.ImportCorrectPolymerHtml(line_number, line),
                self.LabelCheck(line_number, line),
                self.QuotePolymerBindings(line_number, line),
            ] if _f
        ])

      if errors:
        abs_local_path = f.AbsoluteLocalPath()
        file_indicator = 'Found HTML style issues in %s' % abs_local_path
        prompt_msg = file_indicator + '\n\n' + '\n'.join(errors) + '\n'
        results.append(self.output_api.PresubmitPromptWarning(prompt_msg))

    return results
Check for violations of the Chromium web development style guide. See
       https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md
    
Check for violations of the Chromium web development style guide.
Check for violations of the Chromium web development style guide .
def RunChecks(self):
    results = []
    affected_files = self.input_api.AffectedFiles(file_filter=self.file_filter,
                                                  include_deletes=False)
    for f in affected_files:
      if not f.LocalPath().endswith('.html'):
        continue
      errors = []
      for line_number, line in f.ChangedContents():
        errors.extend([
            _f for _f in [
                self.ClassesUseDashFormCheck(line_number, line),
                self.DoNotCloseSingleTagsCheck(line_number, line),
                self.DoNotUseBrElementCheck(line_number, line),
                self.DoNotUseInputTypeButtonCheck(line_number, line),
                self.I18nContentJavaScriptCaseCheck(line_number, line),
                self.ImportCorrectPolymerHtml(line_number, line),
                self.LabelCheck(line_number, line),
                self.QuotePolymerBindings(line_number, line),
            ] if _f
        ])
      if errors:
        abs_local_path = f.AbsoluteLocalPath()
        file_indicator = 'Found HTML style issues in %s' % abs_local_path
        prompt_msg = file_indicator + '\n\n' + '\n'.join(errors) + '\n'
        results.append(self.output_api.PresubmitPromptWarning(prompt_msg))
    return results
def RunChecks ( self ) : results = [ ] affected_files = self . input_api . AffectedFiles ( file_filter = self . file_filter , include_deletes = False ) for f in affected_files : if not f . LocalPath ( ) . endswith ( '.html' ) : continue errors = [ ] for line_number , line in f . ChangedContents ( ) : errors . extend ( [ _f for _f in [ self . ClassesUseDashFormCheck ( line_number , line ) , self . DoNotCloseSingleTagsCheck ( line_number , line ) , self . DoNotUseBrElementCheck ( line_number , line ) , self . DoNotUseInputTypeButtonCheck ( line_number , line ) , self . I18nContentJavaScriptCaseCheck ( line_number , line ) , self . ImportCorrectPolymerHtml ( line_number , line ) , self . LabelCheck ( line_number , line ) , self . QuotePolymerBindings ( line_number , line ) , ] if _f ] ) if errors : abs_local_path = f . AbsoluteLocalPath ( ) file_indicator = 'Found HTML style issues in %s' % abs_local_path prompt_msg = file_indicator + '\n\n' + '\n' . join ( errors ) + '\n' results . append ( self . output_api . PresubmitPromptWarning ( prompt_msg ) ) return results
Check for violations of the Chromium web development style guide.
Check for violations of the Chromium web development style guide .
"""Check for violations of the Chromium web development style guide. See
       https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md
    """
self