Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Side by Side Diff: mojo/spy/PRESUBMIT.py

Issue 687793004: mojom: Remove braces from module statements and make them come first. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/external_service.mojom ('k') | mojo/spy/public/spy.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 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.
4 import os
5 import sys
6
7 def _CommonChecks(input_api, output_api):
8 results = []
9 # Importing ui actually brings tvcm into the path.
10 import ui
11 from tvcm import presubmit_checker
12 checker = presubmit_checker.PresubmitChecker(input_api, output_api)
13 results += checker.RunChecks()
14 return results
15
16 def GetPathsToPrepend(input_api):
17 return [input_api.PresubmitLocalPath()]
18
19 def RunWithPrependedPath(prepended_path, fn, *args):
20 old_path = sys.path
21
22 try:
23 sys.path = prepended_path + old_path
24 return fn(*args)
25 finally:
26 sys.path = old_path
27
28 def CheckChangeOnUpload(input_api, output_api):
29 def go():
30 results = []
31 results.extend(_CommonChecks(input_api, output_api))
32 return results
33 return RunWithPrependedPath(GetPathsToPrepend(input_api), go)
34
35 def CheckChangeOnCommit(input_api, output_api):
36 def go():
37 results = []
38 results.extend(_CommonChecks(input_api, output_api))
39 return results
40 return RunWithPrependedPath(GetPathsToPrepend(input_api), go)
OLDNEW
« no previous file with comments | « mojo/shell/external_service.mojom ('k') | mojo/spy/public/spy.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698