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

Side by Side Diff: tools/dom/PRESUBMIT.py

Issue 13251005: Put in a teardown for the docs test, fixed dom.py to actually run it correctly, added PRESUMBIT. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file.
4
5 import os
6
7
Emily Fortuna 2013/04/01 17:41:20 Just a few comments here talking about how this fi
Andrei Mouravski 2013/04/01 22:43:07 Done.
8 def _AnySdkFiles(input_api):
9 """ Returns true if any of the changed files are in the sdk, meaning we should
10 check that docs.dart was run.
11 """
12 for f in input_api.change.AffectedFiles():
13 if f.LocalPath().find('sdk') > -1:
14 return True
15 return False
16
17
Emily Fortuna 2013/04/01 17:41:20 also, perhaps I'm missing something, but how is th
Andrei Mouravski 2013/04/01 22:43:07 http://www.chromium.org/developers/how-tos/depotto
18 def CheckChangeOnUpload(input_api, output_api):
19 results = []
20 # TODO(amouravski): uncomment this check once docs.dart is faster.
21 # if _AnySdkFiles(input_api):
22 # results.extend(CheckDocs(input_api, output_api))
23 return results
24
25
26 def CheckChangeOnCommit(input_api, output_api):
27 results = []
28 if _AnySdkFiles(input_api):
29 results.extend(CheckDocs(input_api, output_api))
30 return results
31
32
33 def CheckDocs(input_api, output_api):
34 """Ensure that documentation has been generated if it needs to be generated.
35
36 Prompts with a warning if documentation needs to be generated.
37 """
38 results = []
39
40 cmd = [os.path.join(input_api.PresubmitLocalPath(), 'dom.py'), 'test_docs']
41
42 try:
43 input_api.subprocess.check_output(cmd,
44 stderr=input_api.subprocess.STDOUT)
45 except (OSError, input_api.subprocess.CalledProcessError), e:
46 results.append(output_api.PresubmitPromptWarning(
47 ('Docs test failed!%s\nYou should run `dom.py docs`' % (
48 e if input_api.verbose else ''))))
49
50 return results
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698