Commit Graph

137 Commits (ca35be31122f7ff712b2d955ec148f44e9b06156)

Author SHA1 Message Date
maruel@chromium.org ffeb2f36d7 Print test duration in verbose mode.
This is useful to diagnose slow tests. Make this multiprocessing aware. Stop
printing when the commands are added but use the proper message system instead.

R=iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/99453003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@238388 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
erikchen@google.com 12816087e7 Allow obj-c import statements to be as long as necessary.
I've unified the checks for language specific exceptions to line length. There is a behavior change where cpp compiler directives no longer have a maximum line length (previously they were restricted to 150% of max line length). This change was made to match the behavior for java files.

BUG=NONE

Review URL: https://codereview.chromium.org/100163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@238268 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
scheib@chromium.org 93276ab22e Suggest interactive owners tool when suggesting owners.
Review URL: https://codereview.chromium.org/27269002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@228565 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org 31b42c0192 Change the "Missing OWNERS" presubmit check to only suggest owners for missing files.
Previously we would suggest owners for the whole CL, rather than just
the files currently missing owner approval.

R=maruel@chromium.org
BUG=130978

Review URL: https://chromiumcodereview.appspot.com/23591064

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224183 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
danakj@chromium.org c5965bae62 Change default ReportErrorFileAndLine to use filename:lineno format.
Currently the output is:

Found line ending with white spaces in:
cc/trees/layer_tree_host_impl_unittest.cc, line 379

This format is extremely annoying because you must combine the
file and line number together by hand. A more standard format
for expressing a position in a file is filename:lineno. This
changes the format to match:

Found line ending with white spaces in:
cc/trees/layer_tree_host_impl_unittest.cc:379

R=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22837004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@217405 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
nick@chromium.org ff526198c4 presubmit_support: Call git once per change, to get a diff for all files. Parse this result to generate per-file diffs, which go into a cache that's shared between the AffectedFile instances.
Greatly improves presubmit performance on Blink where there may be rule violations (my test case went from 50s to 5s).

BUG=236206
TEST=new test in presubmit_unittest.py; manual performance test on Mac and Windows after touching hundreds of files in webkit; testing included add/move/edit/delete on both binary and text files.

Review URL: https://chromiumcodereview.appspot.com/15898005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@205275 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org bc11731a9e Add support for parallel presubmit unit testing.
Enable parallel tests on depot_tools.
On Z620 presubmit times: 3m -> 35s.

Review URL: https://codereview.chromium.org/14247012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195377 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
bauerb@chromium.org b3b5201bb6 Sort list of files that are missing OWNERS LGTM in presubmit check.
BUG=none

Review URL: https://chromiumcodereview.appspot.com/13852011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194983 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
enne@chromium.org e72c5f519a Add cpplint to presubmit input_api
This will let clients that don't use the heavily filtered canned cpplint
check and want to behave more strictly (aka cc/) reuse any common
settings applied to the cpplint module.

R=maruel@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/13866044

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194264 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
danakj@chromium.org aed892eb62 Teach cpplint include-what-you-use about chromium hash_set and hash_map.
For hash_map and hash_set, we should include "base/hashtables.h", not
the <hash_set> or <hash_map> standard headers.

R=maruel@chromium.org
BUG=


Review URL: https://chromiumcodereview.appspot.com/14139002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194047 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jamesr@chromium.org af27f462d4 Make maxlen configurable in PanProjectChecks
Blink wants to override the maxlen which is currently configurable in CheckLongLines but not in PanProjectChecks. This exposes the parameter on PanProjectChecks.


Review URL: https://chromiumcodereview.appspot.com/13403004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@192394 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org 4c7ce992d7 Fix a crash in the owners check for a change without reviewers.
If we uploaded a CL w/o any reviewers specified, and then
ran the owners check on it (so that we had a Rietveld
issue number) we would crash in a Python assertion. This
wasn't caught in unit testing because of a limitation
in the unit test scaffolding.

TBR=maruel@chromium.org
BUG=None


Review URL: https://chromiumcodereview.appspot.com/12546003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@186454 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org f6ddfa4ba0 Use author as determined from scm if we can not get it from rietveld
Until an issue is uploaded to Rietveld, we don't know the official
email address to use for an owners check. There are three ways to fix
this: we could attempt to log in to rietveld prior to doing the check
and extract the address to use, or we could use ~/.last_codereview_email_address,
or we can use the email address we can determine from the checkout.

All three options have flaws; the first is particularly awkward since there
doesn't seem to be a good way to fetch the email without posting an issue.
The second is flawed if we use different addresses for different repos,
and the third is flawed if the checkout's email address is different from
the rietveld address, or if it is anonymous.

However, since this is only being used for owners checks (in this case),
anonymous checkouts probably don't matter, and hopefully the cases where
the email addresses differ are rare.

R=maruel@chromium.org
BUG=118388, 150049


Review URL: https://chromiumcodereview.appspot.com/12377023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@186259 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org dbf8b4edd4 Add a way to require approval from owners other than the author.
Right now we require approval from someone, and we require an owner
approval, but we don't require an approval from an owner *other than
the patch other*. It's conceivable that we might want this, so
I am making this a configurable argument to the presubmit check.

This will also be needed to ensure that we don't suggest you as an
owner for your own patches, when we actually know who you are.

R=maruel@chromium.org
BUG=


Review URL: https://chromiumcodereview.appspot.com/12326151

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@185294 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org 6b1e3ee9e3 Change the OWNERS check to print files, not directories
Currently, when we run the OWNERS check, we print the list of directories
that contain the relevant OWNERS files for any modified files in a change
still needing approval. 

This has two problems:

1) if we bubble all the way up to the top level OWNERS, we print "" instead of
"src/" or something more useful (bug 157191)

2) for OWNERS files that contain per-file set-noparent entries (like changes to IPC messages), this can be really confusing because an owner of other stuff in the directory might've approved things already.

This change will now print the list of files in the CL that are still unapproved.
This might be a lot more verbose (since you get N lines rather than 1 for N files in a given directory), but hopefully it'll be clearer in the two cases above.

Also, this change takes care of some lingering clean-up in the code to rename some methods to be clearer.

R=maruel@chromium.org
BUG=157191




Review URL: https://chromiumcodereview.appspot.com/12314044

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@184219 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
csharp@chromium.org 40395347a5 Reduce Presubmit pylint logging.
Printing the list of all the files examined can produce a lot
out of output and bury the interesting output.


BUG=


Review URL: https://chromiumcodereview.appspot.com/12315031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@183813 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
robertshield@chromium.org a287393e19 Fix PyLint presbumit check on win.
We were passing a unicode string in the env block to subprocess.Popen which makes it unhappy. This forces the string to ascii first.

BUG=NONE
TEST=NONE


Review URL: https://chromiumcodereview.appspot.com/12255083

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@183569 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
torne@chromium.org 0ecad9c05d Presubmit tests: allow 200 columns in .mk files.
The Android WebView code includes several manually-maintained .mk files
that are included by the Android build system. These contain some fairly
long lines as they need to refer to deep pathnames, which means the CQ
cannot be used as it always triggers a presubmit warning.

Allow .mk files to have 200 columns per line instead, which should be
enough for the long paths that are used. Add a test case for this.

BUG=


Review URL: https://chromiumcodereview.appspot.com/12252067

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@182733 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
chrisha@chromium.org 40e5d3dfa1 Fix pylint presubmit check so that it works on Windows.
r176777 introduced a change that relied on os.path.samepath, which does not exist on Windows.

BUG=


Review URL: https://chromiumcodereview.appspot.com/12021013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@177701 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org dd4e931730 Fix pylint presubmit checks
pylint checks were erronously excluded for PRESUBMIT.py files in
root directory of repos because the regex was getting a './' added.

R=iannucci@chromium.org
TBR=M-A

Review URL: https://chromiumcodereview.appspot.com/11880040

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@176777 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 36576334f3 Escape paths used in regexs for pylint
This fixes a potential issue with RunPylint in windows where paths
can contain special characters.

TBR=iannucci@chromium.org


Review URL: https://chromiumcodereview.appspot.com/11786007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@175481 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 7b677f7a11 Fix RunPylint affected files regex issue
The AffectedSourceFiles query matches against files with paths relative
to repository root.  On the other hand _FindAllFiles checks white_lists
and black_lists against files paths relative to PRESUBMIT.py

As a result, when a PRESUBMIT.py is not at RepositoryRoot, RunPylint
can misbehave.

I fix this by modifying the white_lists and black_list regexes to
include the relative directory of PRESUBMIT.py.

Also adding some logging to pylint and simplified misc logic.


Review URL: https://chromiumcodereview.appspot.com/11776016

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@175364 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jam@chromium.org 1d3f02c716 Revert 171153 to add a presubmit check to check for closed issues.
BUG=161702

Review URL: https://chromiumcodereview.appspot.com/11566014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173104 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 6bf2b45c51 Remove committed check from depot_tools presubmit
BUG=161702

R=maruel@chromium.org


Review URL: https://chromiumcodereview.appspot.com/11438024

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@171277 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org c50d761bca Add presubmit check for dcommitted / CQed CLs
We use the fact the dcommit adds a "Committed:" link to the
description.  If we wanted to be more strict, we could make
git cl dcommit post a comment on the CL (which would be nice
since it would notify reviewers that the CL was committed).

Note that this is untested as written, because it doesn't appear
that we have either git-cl integration tests, nor a test for
git cl dcommit adding the word "Committed:" so as written, this
presubmit check is prone to failure.  Would like suggestions to
improve.

Also adding DoNotSubmit checks and a couple others to
PanPresubmitChecks.

R=maruel@chromium.org,dpranke@chromium.org
BUG=161702

Review URL: https://chromiumcodereview.appspot.com/11421050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@171158 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 1fa5cb9ce3 Add presubmit check to verify issue is not closed.
This can come up when CQ closed an issue but the user's
local branch is still tied to the issue.

BUG=161702


Review URL: https://chromiumcodereview.appspot.com/11348122

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@171153 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dpranke@chromium.org e3b1c3d1e3 Fix swapping of args in call to relpath() that was causing
OWNERS checks on DEPS to fail.

TBR=maruel@chromium.org
BUG=157022



git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@163192 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
sivachandra@chromium.org 270db5c246 Allow special java statements (for example imports) to be as long as neccessary.
BUG=152209


Review URL: https://chromiumcodereview.appspot.com/11043031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@160956 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
sbc@chromium.org 7fc75cac2f make pylint behave the same with or without -v
BUG=http://code.google.com/p/chromium/issues/detail?id=151110


Review URL: https://chromiumcodereview.appspot.com/10956047

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@158064 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
mark@chromium.org 2cc664298b New copyright boilerplate policy for presubmit: don't require the current year
on all modified files, and don't require (c).

BUG=140977
Review URL: https://chromiumcodereview.appspot.com/10824191

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@150417 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
chrisha@chromium.org 1b129e551f Pass arguments to pylint child process via a pipe.
This gets around command-line length limitations.

BUG=
TEST=


Review URL: https://chromiumcodereview.appspot.com/10654002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@143620 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 22a6876246 Fix Pylint presubmit check.
First, the environment variable for the child process was created but not
specified to subprocess.call().

Second, third_party/logilab/__init__.py tried to initialize itself with
pkg_resources.

TBR=chrisha@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10582031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@143111 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
chrisha@google.com 267d659c93 Add pylint to depot_tools.
This CL adds pylint (and its dependencies) to third_party. It plumbs them into presubmit_canned_checks, and exposes a command-line tool to access pylint.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10447014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@143016 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
zork@chromium.org 046e175ff0 Output a list of suggested OWNERS reviewers when needed.
BUG=None
TEST=Change files that need OWNERS review.  Upload the patch.  Check that the warning suggests a minimum set of reviewers.

Review URL: https://chromiumcodereview.appspot.com/10222020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135619 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org ff9a217e26 Add disabled_warnings arg to RunPylint() and use the default pylintrc file by default.
Update pylintrc to be near the pylint 0.25.1 default file.

R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10199016

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133707 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 4f6852cca4 Remove python 2.5 compatibility code.
R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10165007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133265 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
cmp@chromium.org cb5e57ca95 Ensure .mk files aren't included in the tab character check.
R=maruel@chromium.org
TEST=presubmit checks pass

Review URL: http://codereview.chromium.org/10005029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@131171 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
bauerb@chromium.org 4cea01ef65 Allow 'class Singleton<T>' in header files.
BUG=none
TEST='friend class Singleton<T>' is allowed.


Review URL: http://codereview.chromium.org/9756001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@127751 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
pam@chromium.org aba6776889 Add a message that the list of directories needing owners may not be accurate on first upload, because we have no way to know whether the user is an OWNER for any of them.
BUG=117974
TEST=covered by presubmit unit tests

Review URL: http://codereview.chromium.org/9692039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@126894 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
pam@chromium.org f46aed992a Show a list of directories missing OWNER reviewers on upload, and show directories rather than files missing OWNER approvals on commit.
BUG=117166
TEST=covered by presubmit unittests

Review URL: http://codereview.chromium.org/9621012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@125588 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
bulach@chromium.org bfffd45e89 Presubmit tests: allow 100columns limit for .java files.
Chrome for Android introduced the requirement for java files.
Android's style guide:
http://source.android.com/source/code-style.html#limit-line-length
defines 100 columns for .java files.
This patch changes the presubmit tests which are also used by chromium's CQ.

TEST=testCannedCheckJavaLongLines

Review URL: http://codereview.chromium.org/9417023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@122938 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
dbeam@chromium.org b231210c12 [depot_tools] Removing unnecessary capturing regex.
R=maruel@chromium.org
BUG=None
TEST=Copyright check still works.


Review URL: http://codereview.chromium.org/9365077

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@122006 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
rohitrao@chromium.org d490ee8d09 Make the CheckTreeIsOpen presubmit check fail on IOError.
Review URL: http://codereview.chromium.org/9264044

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@120586 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
estade@chromium.org ae7af92aba Add CSS as a source file type.
this forces license headers, no line-end whitespace, etc.

Also update the default license header regex to allow concluding */ on the final line.

Review URL: http://codereview.chromium.org/9109001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@119448 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 85da74b671 Temporarily disable CheckRietveldTryJobExecution() while the Rietveld API is being upgraded
BUG=
TEST=


Review URL: http://codereview.chromium.org/8353039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@107590 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ce71e67b93 Improve pylint error message with an old version is used.
Instead of crashing, prints an error message.

BUG=
TEST=


Review URL: http://codereview.chromium.org/8363030

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@106867 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org fae707be99 Fix a typo that resulted in no tests to be run in depot_tools. :(
Add a warning when RunUnitTestsInDirectory() finds no test to run to
catch this kind of regression.

Fix all the regressions that where introduced in the meantime...

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7906009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101347 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 87e6d33103 Update subprocess2.check_output() to behave like subprocess.check_output().
stderr is not redirected by default. stdout is not allowed.
Both were oversight.
Do not override stdin=None in case the user would response to stderr output for
example.

Increase test coverage.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7860041

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@100456 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dilmah@chromium.org d22b970a0e Ignore C++ comments while checking for Singleton<T> in headers.
(without ignoring comments this check gives false positives on code like base/threading/thread_local.h)
Review URL: http://codereview.chromium.org/7747023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@98421 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org d587f39361 Do not interfere with git cl patch <issue>
R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7493050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@94004 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago