blob: c3243c4d5d4009b669959fd474e85a8ce9286385 [file] [log] [blame]
# Copyright (c) 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=invalid-name,import-error
"""Run eslint on the Streams API Javascript files.
for more details about the presubmit API built into depot_tools, and see
for the rules we're checking against here.
def CheckChangeOnUpload(input_api, output_api):
return common_checks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return common_checks(input_api, output_api)
def common_checks(input_api, output_api):
import sys
web_dev_style_path = input_api.os_path.join(input_api.change.RepositoryRoot(),
oldpath = sys.path
sys.path = [input_api.PresubmitLocalPath(), web_dev_style_path] + sys.path
from web_dev_style import js_checker
sys.path = oldpath
def is_resource(maybe_resource):
return maybe_resource.AbsoluteLocalPath().endswith('.js')
return js_checker.JSChecker(input_api, output_api,