Commit Graph

126 Commits (d88d7f5ce36c2a8a226344e321164e3b2fd8b603)

Author SHA1 Message Date
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
maruel@chromium.org cc73ad68ff Remove manual --tbr support and convert it into automatic TBR= detection.
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
14 years ago
maruel@chromium.org eba646225d Improve CheckLongLines() to increase the hard limit at 50% when an exception is found.
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
14 years ago
maruel@chromium.org 69eaecb312 Use tuple everywhere with explicit conversion.
TEST=Add PanProjectChecks unittest, there was none.

R=dpranke@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@88982 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 751797ac3c turn off source filter for owners check
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@88160 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e4067ab7a2 Switch CheckOwners to use input_api.rietveld.
This enables private issue checking and simplifies testing.

R=dpranke@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87743 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6fba34d0cf Add input_api.logging.
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
14 years ago
maruel@chromium.org 80941c21e4 Use m['approval'] instead of looking at the text for 'lgtm'.
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
14 years ago
maruel@chromium.org fe1211ae6e Improve the sources regexp to be more correct.
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87185 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
sail@chromium.org 5538e022ab Remove presubmit warning for long lines in .grd files
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
14 years ago
maruel@chromium.org 8571dac9c1 In r84572, I forgot to move CheckChangeSvnEolStyle() to commit-only check.
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
14 years ago
maruel@chromium.org b1ce775c29 Move copyright and svn mime check presubmit checks to trigger on commit only.
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
14 years ago