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

    affected_files = self.input_api.AffectedFiles(file_filter=self.file_filter,
                                                  include_deletes=False)
    affected_js_files = [
        f for f in affected_files if f.LocalPath().endswith((".js", "ts"))
    ]

    if affected_js_files:
      results += self.RunEsLintChecks(affected_js_files)

    for f in affected_js_files:
      error_lines = []

      for i, line in f.ChangedContents():
        error_lines += [
            _f for _f in [
                self.BindThisCheck(i, line),
                self.ChromeSendCheck(i, line),
                self.CommentIfAndIncludeCheck(i, line),
                self.DebuggerCheck(i, line),
                self.EndJsDocCommentCheck(i, line),
                self.ExtraDotInGenericCheck(i, line),
                self.InheritDocCheck(i, line),
                self.PolymerLocalIdCheck(i, line),
                self.VariableNameCheck(i, line),
            ] if _f
        ]

      if error_lines:
        error_lines = [
            "Found JavaScript style violations in %s:" %
            f.LocalPath()] + error_lines
        results.append(self.output_api.PresubmitError("\n".join(error_lines)))

    if results:
      results.append(self.output_api.PresubmitNotifyResult(
          "See the JavaScript style guide at "
          "https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md#JavaScript"))

    return results
Check for violations of the Chromium JavaScript style guide. See
       https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md#JavaScript
    
Check for violations of the Chromium JavaScript style guide.
Check for violations of the Chromium JavaScript style guide .
def RunChecks(self):
    results = []
    affected_files = self.input_api.AffectedFiles(file_filter=self.file_filter,
                                                  include_deletes=False)
    affected_js_files = [
        f for f in affected_files if f.LocalPath().endswith((".js", "ts"))
    ]
    if affected_js_files:
      results += self.RunEsLintChecks(affected_js_files)
    for f in affected_js_files:
      error_lines = []
      for i, line in f.ChangedContents():
        error_lines += [
            _f for _f in [
                self.BindThisCheck(i, line),
                self.ChromeSendCheck(i, line),
                self.CommentIfAndIncludeCheck(i, line),
                self.DebuggerCheck(i, line),
                self.EndJsDocCommentCheck(i, line),
                self.ExtraDotInGenericCheck(i, line),
                self.InheritDocCheck(i, line),
                self.PolymerLocalIdCheck(i, line),
                self.VariableNameCheck(i, line),
            ] if _f
        ]
      if error_lines:
        error_lines = [
            "Found JavaScript style violations in %s:" %
            f.LocalPath()] + error_lines
        results.append(self.output_api.PresubmitError("\n".join(error_lines)))
    if results:
      results.append(self.output_api.PresubmitNotifyResult(
          "See the JavaScript style guide at "
          "https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md#JavaScript"))
    return results
def RunChecks ( self ) : results = [ ] affected_files = self . input_api . AffectedFiles ( file_filter = self . file_filter , include_deletes = False ) affected_js_files = [ f for f in affected_files if f . LocalPath ( ) . endswith ( ( ".js" , "ts" ) ) ] if affected_js_files : results += self . RunEsLintChecks ( affected_js_files ) for f in affected_js_files : error_lines = [ ] for i , line in f . ChangedContents ( ) : error_lines += [ _f for _f in [ self . BindThisCheck ( i , line ) , self . ChromeSendCheck ( i , line ) , self . CommentIfAndIncludeCheck ( i , line ) , self . DebuggerCheck ( i , line ) , self . EndJsDocCommentCheck ( i , line ) , self . ExtraDotInGenericCheck ( i , line ) , self . InheritDocCheck ( i , line ) , self . PolymerLocalIdCheck ( i , line ) , self . VariableNameCheck ( i , line ) , ] if _f ] if error_lines : error_lines = [ "Found JavaScript style violations in %s:" % f . LocalPath ( ) ] + error_lines results . append ( self . output_api . PresubmitError ( "\n" . join ( error_lines ) ) ) if results : results . append ( self . output_api . PresubmitNotifyResult ( "See the JavaScript style guide at " "https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md#JavaScript" ) ) return results
Check for violations of the Chromium JavaScript style guide.
Check for violations of the Chromium JavaScript style guide .
"""Check for violations of the Chromium JavaScript style guide. See
       https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md#JavaScript
    """
self