Эх сурвалжийг харах

requires files for git cl lint if called in cog

Reason: In cog, there's currently no way to get the file diff.

Bug: 339231299
Change-Id: Ibe1cf771fbc84a1710ce7f72d13250877d4d21a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539168
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Yiwei Zhang 1 жил өмнө
parent
commit
d431e7606b
1 өөрчлөгдсөн 7 нэмэгдсэн , 2 устгасан
  1. 7 2
      git_cl.py

+ 7 - 2
git_cl.py

@@ -4638,6 +4638,9 @@ def FindFilesForLint(options, args):
             else:
             else:
                 print('%s is not a file' % fn)
                 print('%s is not a file' % fn)
                 return None, None
                 return None, None
+    elif gclient_utils.IsEnvCog():
+        print('Error: missing files to lint')
+        return None, None
     else:
     else:
         # If file names are omitted, use the git APIs to find the files to lint.
         # If file names are omitted, use the git APIs to find the files to lint.
         include_regex = re.compile(settings.GetLintRegex())
         include_regex = re.compile(settings.GetLintRegex())
@@ -4666,8 +4669,10 @@ def CMDlint(parser, args):
     """Runs cpplint on the current changelist or given files.
     """Runs cpplint on the current changelist or given files.
 
 
     positional arguments:
     positional arguments:
-      files           Files to lint. If omitted, it will run cpplint against
-                      all the affected files in the current git checkout.
+      files           Files to lint. If omitted in the current git checkout, it
+                      will run cpplint against all the affected files. If it is
+                      not executed in git checkouts, files to lint must be
+                      provided.
     """
     """
     parser.add_option(
     parser.add_option(
         '--filter',
         '--filter',