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

Side by Side Diff: webrtc/api/android/PRESUBMIT.py

Issue 2377113003: Add presubmit format requirement for webrtc/api/android (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 (c) 2016 The WebRTC project authors. All Rights Reserved.
2 #
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
8
9 def CheckChangeOnUpload(input_api, output_api):
10 results = []
11 results.extend(CheckPatchFormatted(input_api, output_api))
12 return results
13
14 def CheckPatchFormatted(input_api, output_api):
15 import git_cl
16 cmd = ['cl', 'format', '--dry-run', input_api.PresubmitLocalPath()]
17 code, _ = git_cl.RunGitWithCode(cmd, suppress_stderr=True)
18 if code == 2:
19 short_path = input_api.basename(input_api.PresubmitLocalPath())
20 full_path = input_api.os_path.relpath(input_api.PresubmitLocalPath(),
21 input_api.change.RepositoryRoot())
22 return [output_api.PresubmitPromptWarning(
23 'The %s directory requires source formatting. '
24 'Please run git cl format %s' %
25 (short_path, full_path))]
26 # As this is just a warning, ignore all other errors if the user
27 # happens to have a broken clang-format, doesn't use git, etc etc.
28 return []
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698