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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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