Commit Graph

137 Commits (ca35be31122f7ff712b2d955ec148f44e9b06156)

Author SHA1 Message Date
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
nick@chromium.org e06cb4e55d Optimize presubmit checks for win32 where determining the diff
seems to take an inordinate amount of time.  The idea is to
lint whole files, and only try to compute deltas if the file
contains at least one error.

For my environment, the three affected presubmit rules took
2000ms each for a 4-file changelist.  With this change,
all my rules run in about a second, and none take anything
close to 500ms.

Also, since there seem to be environment-dependent factors at
work here, I'm proposing putting timer warnings that print
a message if any check takes longer than 500ms.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82559
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=82568
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82607
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=82653
Review URL: http://codereview.chromium.org/6883050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82762 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nick@chromium.org 7b45069a28 :Revert r82607 (reportedly takes forever on long changes)
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82653 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nick@chromium.org 9c765d7aa1 Optimize presubmit checks for win32 where determining the diff
seems to take an inordinate amount of time.  The idea is to
lint whole files, and only try to compute deltas if the file
contains at least one error.

For my environment, the three affected presubmit rules took
2000ms each for a 4-file changelist.  With this change,
all my rules run in about a second, and none take anything
close to 500ms.

Also, since there seem to be environment-dependent factors at
work here, I'm proposing putting timer warnings that print
a message if any check takes longer than 500ms.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82559
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=82568
Review URL: http://codereview.chromium.org/6883050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82607 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nick@chromium.org cfbdd987b6 Revert 82559.
Review URL: http://codereview.chromium.org/6896004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82568 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nick@chromium.org baa40e63f9 Optimize presubmit checks for win32 where determining the diff
seems to take an inordinate amount of time.  The idea is to
lint whole files, and only try to compute deltas if the file
contains at least one error.

For my environment, the three affected presubmit rules took
2000ms each for a 4-file changelist.  With this change,
all my rules run in about a second, and none take anything
close to 500ms.

Also, since there seem to be environment-dependent factors at
work here, I'm proposing putting timer warnings that print
a message if any check takes longer than 500ms.
Review URL: http://codereview.chromium.org/6883050

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82559 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 6c7723e796 Add --verbose flag when input_api.verbose is set.
It could result in failed tests so I'll revert if it ever becomes problematic.
It ran fine with my limited testing.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@81279 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 899e1c1a61 Add verbose support throught presubmit checks
Add propagation of verbose flag from git cl to presubmit_support

Rename NotImplementedException to standard NotImplementError.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80798 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org ade9c5953d Fix case where wc_info is not present.
Reapply r80770 "Switch from xml.dom.minidom to xml.etree".

TBR=dpranke@chromium.org
BUG=
TEST=

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80785 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org d25fb8f68b Revert r80770 "Switch from xml.dom.minidom to xml.etree"
Throws exceptions on mac.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80771 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 949d1a6a9e Switch from xml.dom.minidom to xml.etree
The reason of this change (beside deleting 30 lines) is to fix pylint on Mac.
For an unknown reason, it was dying here trying to process the minidom import.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80770 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0e766050d2 Use check_call() instead of Popen() for canned checks.
This removes a significant amount of code.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80616 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 725f1c3b69 Add a warning if the current version of python is not 2.5
R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80212 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bradnelson@google.com d57771d024 Make owners check optional.
BUG=None
TEST=None
R=thomasvl@google.com
Review URL: http://codereview.chromium.org/6728031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80043 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 2b5ce56a97 Add RunUnitTests() and RunUnitTestsInDirectory() canned checks.
Deprecate RunPythonUnitTests() since it is a bit awkward.

Add os_listdir, os_walk and platform to InputApi.

GOAL=Slowly adds python 2.5 support for unit tests
BUG=none
TEST=new unit test
R=dpranke@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80009 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bradnelson@google.com 393460b7b3 Making license presubmit check more verbose.
BUG=None
TEST=None
R=dpranke@chromium.org
Review URL: http://codereview.chromium.org/6768006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79644 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mark@chromium.org edf744da57 Relax |const NSClass*| PRESUBMIT check to not detect false positives when
encountering Foundation types that are not id-derived, including NSPoint, 
NSRange, NSRect, and NSSize. 

BUG=77438
TEST=Modify chrome/browser/renderer_host/render_widget_host_view_mac.mm
Review URL: http://codereview.chromium.org/6755007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79564 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 0a2bb37a5f improve logging slightly
Review URL: http://codereview.chromium.org/6736018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79356 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 3e331bdf16 Clean up the parsing of approvals for OWNERS checks.
This fixes bugs 76724. We will now allow approvals from
only non-owners to be sufficient if the patch is from an OWNER.

Also, this strips out the code for suggesting reviewers during upload completely. I've come to believe that this should be done by gcl and git-cl directly rather than through a presubmit hook, when the change is being initially created. CheckOwners() is now a no-op on upload.

(We might need to add a new value to the codereview.settings file instead to indicate if we want this to happen).

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79339 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 0d1bdeadb7 fix a few minor lint and test issues. Note that presubmit_canned_checks
should never import any modules directly but always access modules
through input_api.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79337 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bradnelson@google.com 56e48bcb48 Moving several chromium presubmit checks into the common pool for use in other
projects.

BUG=None
TEST=None

R=erikkay@chromium.org,dpranke@chromium.org,maruel@chromium.org
Review URL: http://codereview.chromium.org/6713101

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79316 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 1b98c432ca Check for a missing scheme in the input_api.host.
R=chase@chromium.org,maruel@chromium.org
Review URL: http://codereview.chromium.org/6712007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78599 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 5ac2101164 This change moves the code I added to git-cl to parse the results of the presubmit hooks into presubmit_support itself. It also removes a lot of the text-file parsing that is no longer necessary since everything is in process.
It also simplifies all of the PresubmitResult* objects and the way we're using output streams since we can assume more about how the callers are calling us.

Note that I uses PEP-8 style method names where I was adding entirely new classes (or rewriting existing classes completely) since per maruel@ he is trying to new that style for new code.

This change also contains two small changes to git_cl to fix bugs and restore the previous behavior of --force skipping the presubmit checks.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78328 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 4ea24734f6 fix case where an issue may not have any messages yet
Review URL: http://codereview.chromium.org/6684026

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78089 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 970c522f0f Make git-cl work with OWNERS file hooks properly.
This version calls into presubmit_support directly to support the OWNERS hooks. We do not need both this patch and http://codereview.chromium.org/6646009/

This patch depends on http://codereview.chromium.org/6665018/ .

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77898 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 627ea67f26 Actually check Rietveld for LGTMs ...
This change requires us to change the previous signature for the CheckOwners() hook to provide the server address and email regexp to use for parsing approvals from Rietveld.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77891 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 3ae183fbb7 add PresubmitAddText() result class to indicate that text needs to be passed back to git cl / gcl.
Also, this properly wires up the presubmit code to the owners code and adds unit tests.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77523 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org add5df4c4a fix typos in CheckOwners()
Review URL: http://codereview.chromium.org/6628072

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77361 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 0c4a6a3a70 add source_file_filter to CheckOwners() presubmit check
Review URL: http://codereview.chromium.org/6591064

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76459 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 2a00962421 Add first changes needed for OWNERS file support.
This changes adds the first pass of code needed for OWNERS files.
In total there should probably be maybe four user-visible changes:
  * new gcl/git-cl "suggest-reviewers" command
  * a presubmit hook on upload to automatically add the reviewers
  * an addition to gcl/git-cl status command that tells you
    which files still need review/approval.
  * a presubmit hook on commit to ensure all of the needed reviewers
    have approved the file.

This change implements a core "owners Database" object with the
dumbest possible algorithm for determining a covering set of reviewers,
and the skeleton of the presubmit hooks. This code will not be
used by anything yet, and is also missing unit tests.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76342 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 07ab60e26f Move reverting code from gclient_scm to scm to be able to reuse the code.
There is 2 changes while moving the code:
- Making externals handling an option.
- Not trapping EnvironmentError.

This code will be reused by the commit queue.

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74181 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
estade@chromium.org fdcc9f7f4c Add a presubmit test that asserts TODOs have owners.
For example, TODO(foo) is ok, but TODO: do something is not.

BUG=none
TEST=included

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@74032 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
jam@chromium.org 5c76de9423 Don't prompt developers to add blank test= or bug= lines.
Review URL: http://codereview.chromium.org/6391001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@72349 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 5d0dc43e26 Fix path filtering to be on the relative path and no on the absolute path.
Add logging to presubmit_support.py.

BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@70378 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org fca5339456 Workaround the fact that pylint calls sys.exit().
Otherwise the following presubmit checks where never called.

TBR=nsylvain
BUG=
TEST=fixes unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69844 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org bf38a7ed53 Enhance RunPylint to use white_list and black_list arguments.
Change RunPylint to parse all .py files when one is modified.

Make all depot_tools/tests pass on pylint. That mostly meant fixing some
builtins aliasing, wrong alignment and turning off most remaining warnings.

BUG=none
TEST=unit tests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69159 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org e94aedc26f Add RunPylint as a canned presubmit check.
Adding it as I figured out how to make it run correctly on ubuntu 10.4 and it's
used in enough places it warrants a canned check.

BUG=none
TEST=it self tests itself.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69051 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org b17b55beca Disable the remaining pylint warnings locally and enable pylint warnings in PRESUBMIT.
This causes some code clutter.

TEST=Increased pylint warning level
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64913 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cb2985fb69 Largely reduce the number of pylint warnings and fix one typo.
Most of them are style issues or variable aliasing.

TEST=Can almost enable pylint warnings
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64908 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 716268585a Make CheckLicense() to not trigger on empty files.
This is especially annoying on empty __init__.py files.

TEST=new unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64904 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org cf1982cb17 Don't check number of pending builds for offline builders.
TEST=none
BUG=29953

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61371 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
thakis@chromium.org 09829bf043 Make presubmit output less annoying for mac people.
Review URL: http://codereview.chromium.org/3521006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61277 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
bradnelson@google.com c0b332a8cb Adding json based tree open check.
BUG=None
TEST=None

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57438 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 115ae6cab3 Makefiles will always contain tabs so make the notab check filter them out.
Review URL: http://codereview.chromium.org/2814017

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@50251 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b109e6a567 Ignore case in tree status check
BUG=chromium-os:2308

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@48488 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org eea4dfbe32 When the tree is closed, it's closed.
Convert the warning to error.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42572 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 3fbcb08a1d Add new canned checks: CheckRietveldTryJobExecution and CheckBuildbotPendingBuilds
These are the same that the one in chromium's src/PRESUBMIT.py but slightly more
resilitent to exceptions.
Empirical studies have shown that exceptions in presubmit checks result in
disorientation and lack of willingness to commit.

TEST=OMG new unit tests!

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@42102 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org ba55177642 Fix licensing headers and move most third party code to third_party/
Moved tests/pymox to third_party/pymox
Moved upload.py to third_party/upload.py
Fixed tests so they can run standalone
Fixed the executable bit on some scripts

TEST=none
BUG=34376
Review URL: http://codereview.chromium.org/562031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37987 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
estade@chromium.org 593258b903 Add a trailing \ when printing filenames for presubmit checks.
This makes it easier to apply commands to a set of files. For example:

Run the command: svn pset svn:eol-style LF \
  chrome/browser/extensions/extension_accessibility_apitest.cc \
  chrome/browser/extensions/extension_accessibility_api_constants.cc \
  chrome/browser/extensions/extension_accessibility_api.h \
  chrome/browser/extensions/extension_accessibility_api.cc \
  chrome/browser/extensions/extension_accessibility_api_constants.h \
  chrome/browser/gtk/accessible_widget_helper_gtk.h \
  chrome/browser/gtk/accessible_widget_helper_gtk.cc \
  chrome/browser/gtk/accessibility_event_router_gtk.h \
  chrome/browser/gtk/accessibility_event_router_gtk.cc \
  chrome/common/accessibility_events.cc \
  chrome/common/accessibility_events.h

requires just 1 copy-paste.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37350 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org b9e7adaa82 Add presubmit_canned_checks.CheckLicense()
It does a regexp search on the file contents to make sure it contains expected license boiler plate.

It is a generalization to implement the equivalent of ubuntu's license check script into the corresponding PRESUBMIT.py files.

TEST=unit tests
BUG=28291

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37338 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
erg@google.com 26970fa907 - Add a presubmit check that lints C++ files (will submit CLs that
add this to PRESUBMIT.py in the chromium tree later).
- Update cpplint.py to the latest version from the style guide.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32180 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e3608dfc1a Run pychecker over most scripts in depot_tools. Catched a few bugs.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31590 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
kbr@google.com ab318594b3 Added "gclient pack" subcommand, which generates a patch relative to
the root of the source tree. It is similar to "gclient diff", and
shares much of the implementation, but it seems that developers may
want the semantics of each in different situations, which is why it is
being added as a new command.

Generalized SubprocessCallAndCapture into SubprocessCallAndFilter.
Added RunSVNAndFilterOutput; changed RunSVNAndGetFileList to use it.
Fixed problem in presubmit_canned_checks.py where it was not working
on Windows. Updated unit tests for gclient.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25410 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
thestig@chromium.org da8cddddfe Add a presubmit check for accidental checkins of files under a SVN modified directory.
Review URL: http://codereview.chromium.org/155489

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@23271 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
ukai@chromium.org a301f1f3e4 Use input_api.os_path.pathsep instead of ';' to join a list of paths.
BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@22473 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e49187c280 Fix CheckSvnProperty canned check.
It was totally broken until I actually tried it. Fix the test accordingly.

TEST=unit test
BUG=none
Review URL: http://codereview.chromium.org/149096

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@19433 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c0b2297c8a Change RunPythonUnitTests() to run the unit tests in a separate process.
The unit tests could modify global state in hard-to-revert ways and would make the PRESUBMIT.py check flaky.
Having the test running out of process alleviate any potential issue at the cost of speed (more noticeable on Windows).

TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@19248 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 46e832a00b Add svn:mime-type canned checks.
TEST=new unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18739 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org ccde1c92e6 Write the command to execute in the error message so people don't have to learn how svn works.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18273 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org f5888bb793 Add CheckChangeHasNoStrayWhitespace().
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18081 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 0874d47499 Update CheckChangeSvnEolStyle() to be upload-friendly.
TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18079 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org bc50eb4a88 Add CheckChangeHasDescription.
TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18077 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e9b71c9b3a Add CheckChangeHasOnlyOneEol and CheckChangeHasNoCrAndHasOnlyOneEol.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18075 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 1a0e3cb2cc Add the default parameter to CheckChangeSvnEolStyle.
TEST=unit test
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18074 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org c809ec2749 Suppress RunPythonUnitTests output while running.
The output is only shown when it's failing. It makes the presubmit check much cleaner.
Also rename TestDescription and TestContent that were ill named.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/118415

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18055 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org b7d469083f Add CheckChangeSvnEolStyle presubmit canned check.
TEST=unit tests
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18053 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 3410d917f3 Add InputApi.AffectedSourceFile() and custom filtering support.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17975 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 5c2720e46c Make the CheckLongLines() less restrictive in cases where it's hard to enforce.
TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17937 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 44a17adf95 Add InputApi.ReadFile() and presubmit_canned_checks.CheckChangeHasNoCR().
ReadFile limits to reading files inside the repository.
CheckChangeHasNoCR reads the text files looking for \r and fails if found.

TEST=none
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17857 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org de0ba297d9 Fix presubmit_support.py run standalone and RunPythonUnitTests
TEST=none
BUG=none
TBR=joi

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17839 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 8949138ee9 Use more sensible behavior in presubmit checks.
It's less annoying to type Y than to have to rerun the scripts with --no_presubmit for certain checks.

TEST=none
BUG=none
TBR=joi

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17838 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org d7dccf5614 Add InputApi.is_committing to be able to return a failure or notification, depending on the check.
Add input_api.traceback, useful for dumping information.

BUG=none
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17837 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 1487d53b6c Improve the presubmit_canned_checks testing by using a real mock and testing for more cases.
Remove a superfluous check in CheckLongLines().

Add unittest to InputApi.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17805 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org e1a524ff00 Remove SPECIAL_KEYS and GclChange.Changelist() to simplify the code.
Review URL: http://codereview.chromium.org/113883

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16983 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 7b305e8c18 Add new presubmit check RunPythonUnitTests.
Review URL: http://codereview.chromium.org/115516

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16390 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
kuchhal@chromium.org 00c41e457b Add presubmit checks to look for BUG= and TEST= tags in change list description (Part 1 of 2).
BUG=11287
TEST=gcl commit should fail unless BUG= & TEST= exist in change list description or --no_presubmit is used.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@15905 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@google.com fb2b8eb2e2 Create the Next Generation of depot_tools. Eh.
Review URL: http://codereview.chromium.org/92087

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