1 # Copyright 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
8 def _CommonChecks(input_api
, output_api
):
11 # TODO(nduca): This should call update_docs.IsUpdateDocsNeeded().
12 # Disabled due to crbug.com/255326.
14 update_docs_path
= os
.path
.join(
15 input_api
.PresubmitLocalPath(), 'update_docs')
16 assert os
.path
.exists(update_docs_path
)
17 results
.append(output_api
.PresubmitError(
18 'Docs are stale. Please run:\n' +
19 '$ %s' % os
.path
.abspath(update_docs_path
)))
21 results
.extend(input_api
.canned_checks
.RunPylint(
22 input_api
, output_api
, black_list
=[], pylintrc
='pylintrc'))
25 def GetPathsToPrepend(input_api
):
26 return [input_api
.PresubmitLocalPath(),
27 os
.path
.join(input_api
.PresubmitLocalPath(), os
.path
.pardir
,
28 os
.path
.pardir
, 'third_party', 'typ')]
30 def RunWithPrependedPath(prepended_path
, fn
, *args
):
34 sys
.path
= prepended_path
+ old_path
39 def CheckChangeOnUpload(input_api
, output_api
):
42 results
.extend(_CommonChecks(input_api
, output_api
))
44 return RunWithPrependedPath(GetPathsToPrepend(input_api
), go
)
46 def CheckChangeOnCommit(input_api
, output_api
):
49 results
.extend(_CommonChecks(input_api
, output_api
))
51 return RunWithPrependedPath(GetPathsToPrepend(input_api
), go
)