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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
It result in less code, forces uploading the change for eventual review and most
importantly enables the commit queue to correctly handle this.
BUG=
TEST=
Review URL: http://codereview.chromium.org/7253015
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@91575 0039d316-1c4b-4281-b951-d872f2087c98
Improve the list of exception to include very_long_symbol_names.
R=dpranke@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/7097012
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@89696 0039d316-1c4b-4281-b951-d872f2087c98
This makes it possible to dump logging information from a PRESUBMIT script when
calling git cl presubmit -v -v -v for example.
R=dpranke@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/7027031
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87603 0039d316-1c4b-4281-b951-d872f2087c98
This makes it coherent with the commit queue by keeping the lgtm at a single
place.
This simplifies owners check code.
R=dpranke@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/7082029
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87251 0039d316-1c4b-4281-b951-d872f2087c98
The presubmit check complained about long lines in .grd files. This isn't a useful warning since .grd files aren't really source files.
The problem was that callers were passing in a file filter to InputApi.AffectedFiles but it was being ignored. Fix was to use the passed in file filter.
BUG=None
TEST=Ran on a local change and verified that I no longer got long line warnings on .grd files.
Review URL: http://codereview.chromium.org/6932060
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@85148 0039d316-1c4b-4281-b951-d872f2087c98
This check is also handled by the commit bot so no need to harass people when
uploading.
R=dpranke@chromium.org
BUG=none
TEST=Nobody wrote a test for PanProjectChecks() and I didn't write this function, no way I won't.
Review URL: http://codereview.chromium.org/6998008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@84814 0039d316-1c4b-4281-b951-d872f2087c98
The commit bot automagically fixes these issues so the devs don't need to fix these problems
TEST=none
BUG=none
R=dpranke@chromium.org
Review URL: http://codereview.chromium.org/6948006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@84572 0039d316-1c4b-4281-b951-d872f2087c98