Commit Graph

249 Commits (chrome/3904)

Author SHA1 Message Date
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