Commit Graph

249 Commits (chrome/3904)

Author SHA1 Message Date
Edward Lemur 940c282116 depot_tools: Make it possible to run python3 tests on PRESUBMIT.
Add run_on_python2 and run_on_python3 to allow to be tests on
either only python2, only python3 or both.

Bug: 984182
Change-Id: I87d3b67412129cf3a8e627cd6bc97daa81147657
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1758849
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: smut <smut@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Mike Frysinger 53297790de pylint: rework wrapper to use vpython for multiple versions
This allows people to pin a specific version of pylint when running
it.  The default behavior is unchanged: we run pylint-1.5.6 still
as we've created a vpython wheel in cipd for it.  But for projects
that want to move to a newer version, they can pick any of the new
1.x wrappers.  Having the full set of versions here allows projects
to incrementally move to newer versions as the lint delta between
1.5 & 1.6 tends to be much smaller than 1.5 & 1.9.

We don't include support for the newer 2.x series as those only
support Python 3 which the codebase isn't ready for.

Bug: 866772
Test: `./pylint ...` still works & shows pylint-1.5
Test: `./pylint-1.5 ...` runs the v1.5 version
Test: `./pylint-1.8 ...` runs the v1.8 version
Change-Id: I7c47187493564db81e3eb28c6dbd09e6309ead46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1752507
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
6 years ago
John Budorick a151265d61 Make presubmit emit a warning when it can't find the desired luci config set.
Useful in cases like the green presubmit runs on crrev.com/i/1434617/2

Bug: 925774
Change-Id: I37ce2be843d76ace0615cd3313e5c8421504a1ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1687122
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
6 years ago
Aaron Gable aca5b6aca8 Add JSON-parsing presubmit check
This is followup from the malformed-json bug which took down
Sheriff-o-Matic on 2019-05-16. This CL just adds the canned check;
future CLs can either add it to PanProjectChecks or add it to
other PRESUBMIT files directly.

Change-Id: I4a445193c1744966a448b12c7eb2915873e484d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1617941
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Sean McCullough <seanmccullough@chromium.org>
6 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
6 years ago
Vadim Shtayura 39b0b8e32a Add presubmit check that runs 'lucicfg validate <script>'.
R=tandrii@chromium.org
BUG=925532

Change-Id: I72ab6108cf43353e36ddeccd705acdd04716f785
Reviewed-on: https://chromium-review.googlesource.com/c/1448634
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
David 'Digit' Turner 31a486419e Improve no-long-lines check for Python files.
The previous implementation of CheckLongLines did not
handle global pylint disable/enable directives properly,
i.e. the difference between:

   # pylint: disable=line-too-long
   .... checks disabled for all lines here.
   # pylint: enable=line-too-long

versus:

   # Check only disabled for the line below
   some python statements   # pylint: disable=line-too-long

This CL changes the implementation to support Python files
properly. Note that in order to not disturb the mock-based
unit-tests, a new function is introduced to be able to
filter the list of affected files based on their file
extension.

BUG=890734
R=mattcary@chromium.org,ehmaldonado@chromium.org,dpranke@chromium.org

Change-Id: Id52deff53913b8d47a4157f42b1fffbd3b103201
Reviewed-on: https://chromium-review.googlesource.com/c/1396094
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
6 years ago
Nodir Turakulov 390028fd6b Do not validate deleted configs
This bug caused https://logs.chromium.org/logs/infra-internal/buildbucket/cr-buildbucket.appspot.com/8925230260185002096/+/steps/presubmit/0/stdout

Tested locally

R=vadimsh@chromium.org

Change-Id: I9c42b7d7e9a1366e00fe40ca8a9f18ff0629663a
Reviewed-on: https://chromium-review.googlesource.com/c/1396527
Auto-Submit: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
6 years ago
Edward Lemur db0055dc78 presubmit: Fix CheckOwnersFormat
Fix CheckOwnersFormat so that it checks the new OWNERS files instead of the
original ones.

Change-Id: I4abb1cfc847bd28f45b9948fe7775c10dcc8a420
Reviewed-on: https://chromium-review.googlesource.com/c/1382946
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Ryan Tseng f28ef9887e Add bypass_warnings flag to Commit Format check
Right now, if clang-format is broken, a CL will still pass CQ.
This adds a flag so that it will fail CQ.

Bug: 911708
Change-Id: I2c71b7bc434fc611d51f688266be6a265b80f4da
Reviewed-on: https://chromium-review.googlesource.com/c/1361560
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
6 years ago
Aiden Benner 99b0ccb45a Enable python formatting by default if yapf file provided
Enables python formatting in git cl format by default
for all files that have a .style.yapf file in a parent
directory up to the repository root. If no .style.yapf
file is found the --python flag still needs to be
set explicitly for python formatting to be enabled.
Also adds a --no-python to explicitly disable python
formatting on any file even if a .style.yapf file is found.

This allows default formatting to be enabled on a per
project/directory basis by adding a .style.yapf file.

Bug:846432
Change-Id: I40d899ec1a3e0dfca445e04b91befab113416175
Reviewed-on: https://chromium-review.googlesource.com/c/1316415
Commit-Queue: Aiden Benner <abenner@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
6 years ago
Vadim Shtayura 2174136d25 [cipd] Add presubmit support for checking *.digests file.
Not enabling it yet, since PRESUBMIT.py uses presubmit_canned_checks.py from
depot_tools at HEAD, not from a CL (thus enabling this check in this CL will
make it fail the presubmit).

R=nodir@chromium.org
BUG=870166

Change-Id: I97802ec37f1f7513dfca3950f7f38a5c51ab0350
Reviewed-on: https://chromium-review.googlesource.com/1227432
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
7 years ago
Robert Sesek 16a396e431 Clarify OWNERS error if using TBR.
The message was previously not clear that if the entire CL has any change
to an OWNERS file, TBR will not apply.

Change-Id: Ib30a93f80196f45b02a29701faab7cf581e37f50
Reviewed-on: https://chromium-review.googlesource.com/1176321
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
7 years ago
Nodir Turakulov 425d9ce2d3 Allow CheckPatchFormatted to cause a failure
Extend CheckPatchFormatted to allow other presubmit result types.

Change-Id: I1c592d73657aa9c8a8fd04dbd66f086ce7bb1274
Reviewed-on: https://chromium-review.googlesource.com/1100127
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Sergiy Byelozyorov 621fe6f9b5 Add ability to whitelist bot accounts as valid authors
Example usage: https://crrev.com/c/1074367

R=machenbach@chromium.org

Bug: 831171
Change-Id: Ic3deff5040a268e10161ccce635f06b7f8c08d36
Reviewed-on: https://chromium-review.googlesource.com/1074368
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
7 years ago
Nodir Turakulov 0ae14e9aad [presubmit] Add python formatting check
Add check_python parameter to CheckPatchFormatted to check that python
files are well formatted.

Change-Id: Ibd20d5ec9d1d5142a26f7f4cd5f05c51223da6ca
Reviewed-on: https://chromium-review.googlesource.com/1081342
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Jeremy Roman 5ae86d2021 Update canned PRESUBMIT checks to report that TBR does not apply to OWNERS.
Expansion of the tests to check for this are required.

Change-Id: Iae6294501659738df5097ce5a72da79e72818d98
Reviewed-on: https://chromium-review.googlesource.com/1030956
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
7 years ago
Edward Lesmes cb62e48b54 Check format of OWNERS files in PRESUBMIT and PanProjectChecks.
Bug: 789773
Change-Id: Iaa721c9971d1834dd796a9cd28a28a83b6482e05
Reviewed-on: https://chromium-review.googlesource.com/1019975
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lesmes 067ef5d894 Add support for checking that OWNERS files are correctly formatted.
Bug: 789773
Change-Id: I4c6c676a821fad33a34ef6c46468af95cdf6c0ec
Reviewed-on: https://chromium-review.googlesource.com/1020073
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
7 years ago
John Budorick 161623779e presubmit: don't attempt to verify nonexistent vpython specs.
Bug: 834180
Change-Id: I431431e4fdf99c16c5fc3dbc7ed999b0c8da24bc
Reviewed-on: https://chromium-review.googlesource.com/1016690
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Aaron Gable 668c1d8d1f Reland "Remove Rietveld support from presubmit"
Since no one can upload or land changes from Rietveld anymore,
PRESUBMIT and its support files no longer need to be able to
support it.

Bug: 770408
Change-Id: I4ca6391291e7b0755c78af453c3d006ad3666a17
Reviewed-on: https://chromium-review.googlesource.com/991053
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable aa6ddc6017 Revert "Remove Rietveld support from presubmit"
This reverts commit f3eed0016e.

Reason for revert: Some PRESUBMIT checks still expect 
CheckRietveldTryJobExecution to exist.

Original change's description:
> Remove Rietveld support from presubmit
> 
> Since no one can upload or land changes from Rietveld anymore,
> PRESUBMIT and its support files no longer need to be able to
> support it.
> 
> R=​tandrii@chromium.org
> 
> Bug: 770408
> Change-Id: I749092b66fdca16d5cef77e8cefc905aa5375b50
> Reviewed-on: https://chromium-review.googlesource.com/693380
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=agable@chromium.org,tandrii@chromium.org

Change-Id: I72e29bd8a9739406f29190adbeb7eb7718ed21cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 770408
Reviewed-on: https://chromium-review.googlesource.com/991012
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable 8678d32937 Disallow TBRs to OWNERS files
TBRs bypass owners checks, but are also semi-suspicious: a
contributor TBRing many changes in a row to submit code to
a directory they don't own would be seen, frowned upon, and
inquired into. However, a contributor could bypass this by
simply TBRing a single change to add themselves to an OWNERS
file, and then contributing as normal from there. This CL
removes that loophole.

This will not affect sheriffs who TBR reverts for two reasons:
first, it is rare that a chance touches both code and an
OWNERS file, and therefore it is rare that OWNERS changes
get reverted; second, quick reverts (the kind sheriffs do)
bypass PRESUBMIT entirely, and therefore also skip OWNERS
checks.

Bug: 688115
Change-Id: If2b5c9d058c62caf95389287e0bb706aef721baf
Reviewed-on: https://chromium-review.googlesource.com/982601
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
7 years ago
Aaron Gable f3eed0016e Remove Rietveld support from presubmit
Since no one can upload or land changes from Rietveld anymore,
PRESUBMIT and its support files no longer need to be able to
support it.

R=tandrii@chromium.org

Bug: 770408
Change-Id: I749092b66fdca16d5cef77e8cefc905aa5375b50
Reviewed-on: https://chromium-review.googlesource.com/693380
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Robert Iannucci 82a6480a3a [presubmit_canned_checks] Stop exporting sys.path into PYTHONPATH.
Again, sys.path shouldn't ever be exported into PYTHONPATH :)

R=eakuefner@chromium.org, nodir@chromium.org, vadimsh@chromium.org

Bug: 825290,825174
Change-Id: Ia0594da3ff25972a08fdf74ae2aef5be79cbf3af
Reviewed-on: https://chromium-review.googlesource.com/978594
Reviewed-by: Ethan Kuefner <eakuefner@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Robert Iannucci 23bd73535c Clear $VPYTHON_CLEAR_PYTHONPATH when setting $PYTHONPATH.
On buildbot (only), we don't trust PYTHONPATH, so we have set
VPYTHON_CLEAR_PYTHONPATH to make the first invocation of vpython in a
given chain of python invocations clear PYTHONPATH.

This has the unfortunate side-effect that python scripts that set
PYTHONPATH and then call into vpython (like presubmit) end up
having their PYTHONPATH modifications removed.

As a workaround (until I clean up PYTHONPATH in buildbot for real), fix
presubmit_canned_checks so that it clears VPYTHON_CLEAR_PYTHONPATH when it
adjusts PYTHONPATH.

R=charlie@chromium.org, nodir@chromium.org, vadimsh@chromium.org

Bug: 825290,825174
Change-Id: Ib5f73add1726fdf3c335d26fc0af76cfe3b747b2
Reviewed-on: https://chromium-review.googlesource.com/978632
Reviewed-by: Charlie Andrews <charliea@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Robert Iannucci 5025893cb6 [presubmit_support] Prevent depot_tools' virtualenv from leaking into other repos.
Currently in LUCI `git cl` is invoked on chromium_presubmit using vpython. This
means that it operates under the depot_tools .vpython environment (which is
blank).

Some features in presubmit_support allow invocation of python subprocesses, and
previously they would use `sys.executable` (especially on windows, but
occasionally on non-windows as well).

In non-vpython environments, this just picks up the system python and whatever
modules happen to be installed there. Some python unittests work around this on
non-windows systems by having a shebang line which explicitly invokes vpython.

This CL changes presubmit_support so that invocations of 'python', or executions
of '.py' scripts will always end up invoking vpython. In the best case, this will
pick up the invoked scripts' vpython environment. In the worst case, this will
invoke the script under an empty vpython environment (aka "stock python").

R=dpranke@chromium.org, jbudorick@chromium.org, tandrii@chromium.org, tikuta@chromium.org

Bug: 821669
Change-Id: I5d2d5dfd0364022d56833c2c8af4983553a29c7a
Reviewed-on: https://chromium-review.googlesource.com/961865
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Andrii Shyshkalov 63560ada2d Notify presubmit owners check that we use Gerrit now.
R=agable@chromium.org

Change-Id: I5300756aad893878d63154d9f1f431f41add8ef4
Reviewed-on: https://chromium-review.googlesource.com/912757
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur 707d70b91e Skip files owned by reviewers when quering for missing owners.
Bug: 728298
Change-Id: If813ff41b1668a2cab6c26b65e424fbe574e629c
Reviewed-on: https://chromium-review.googlesource.com/899086
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Mun Yong Jang b2af9586a0 [presubmit] Do not log file content in CheckChangedLUCIConfigs
Bug: 761488
Change-Id: Ic9f7fd50ce33b129436242dd86d183fd3fe83774
Reviewed-on: https://chromium-review.googlesource.com/838080
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang 603d01e818 [presubmit] Use GerritAccessor in CheckChangedLUCIConfigs
For tryjobs, determine the remote branch using GerritAccessor

Bug: 761488
Change-Id: Ieea6028d222af0014ec3a57c3ad7b7eb8af5ec33
Reviewed-on: https://chromium-review.googlesource.com/834995
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Mun Yong Jang cfb9a236fb [presubmit] Add logging for CheckChangedLUCIConfig
Add logging for location prefix

Bug: 761488
Change-Id: I2e742fced588111feacf94877487a6c65fffc78e
Reviewed-on: https://chromium-review.googlesource.com/833087
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Robert Iannucci 7d47eb5495 [PRESUBMIT] Add cipd package checks for all known manifests.
This also improves the cipd manifest canned check to produce unique
names in order to debug PRESUBMIT's more easily.

Adds onto
  https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/708354

R=maruel@chromium.org, tandrii@chromium.org, vadimsh@chromium.org

Bug:
Change-Id: I9f086996998608092a4d23f5c98fbac34117a9e4
Reviewed-on: https://chromium-review.googlesource.com/811445
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Mun Yong Jang b278ddd939 [presubmit] Remove line
Bug:
Change-Id: Ife9b3eaec3031de1fa4324e345f8e30012ed618a
Reviewed-on: https://chromium-review.googlesource.com/806241
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang 17995a9f12 [depot_tools] Remove deprecated config check in canned checks
Bug: 785114
Change-Id: Ic98995d670b22ba17ef6139ed086cb1b31c7d39c
Reviewed-on: https://chromium-review.googlesource.com/804736
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang 00fc72856b [presubmit] Rename to CheckChangedLUCIConfigs
Bug: 785114
Change-Id: I53c3b4e54f39f4bacf8fb0bda1de4e4b0e1b280b
Reviewed-on: https://chromium-review.googlesource.com/771592
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Mun Yong Jang <myjang@google.com>
7 years ago
Mun Yong Jang acc8e3ebaa [presubmit] Extend depot tools auth to use luci context
Bug: 509672
Change-Id: Ie3cb2fa1a2276f1fe658cdf7b9ffb657d03556e8
Reviewed-on: https://chromium-review.googlesource.com/754340
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang 7af1dc56fc [presubmit] Base64 encode for config validation
Bug: 782328
Change-Id: I5219416371cc1b3dfc1f93fee6d1067ef5a6e3d3
Reviewed-on: https://chromium-review.googlesource.com/758719
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang 4bb7dacb8c [presubmit] Address dependent local branches
Bug: 781478
Change-Id: Id07fdca70418c5e564eab8322df51a4004acc937
Reviewed-on: https://chromium-review.googlesource.com/754379
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Mun Yong Jang <myjang@google.com>
7 years ago
Sergiy Byelozyorov eba8347018 Add CheckVPythonSpec for verifying .vpython file syntax
This check will be used in Chromium, V8 and Catapult PRESUBMIT scripts.

R=maruel@chromium.org, tandrii@chromium.org

Bug: 777893
Change-Id: I2ca1e774b89787c4d3b5f336315d145571858864
Reviewed-on: https://chromium-review.googlesource.com/738169
Commit-Queue: Sergiy Byelozyorov <sergiyb@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Daniel Jacques <dnj@chromium.org>
7 years ago
Mun Yong Jang 781e71e49f [presubmit] Add check to call validation endpoint for config files
Bug:509672
Change-Id: I74bbaa725be829c625cd617c58b3e849acb18102
Reviewed-on: https://chromium-review.googlesource.com/726847
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Michael Achenbach 590420d5d4 Make authors-check error out instead of warn on commit
Bug: 775854
Change-Id: I6f831a2536de3cadbeaede7b78cfcf7d41f77052
Reviewed-on: https://chromium-review.googlesource.com/725328
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
7 years ago
Andrew Grieve d3b2548e57 Fix CheckPatchFormatted() error message when using inherit-review-settings-ok
Follow-up to d86c803715. The error message
was still saying "src" rather than the repository root.

Bug: 768962
Change-Id: I781191e561db889a28acf51ee49a20d6d352b489
Reviewed-on: https://chromium-review.googlesource.com/719718
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
7 years ago
Dan Jacques 94652a3767 Add CIPD manifest PRESUBMIT.
Add CIPD manifest PRESUBMIT canned checks.

BUG=None
TEST=local

Change-Id: Ibf739147f47b4f38a2892c856cf45c5839d1c3e7
Reviewed-on: https://chromium-review.googlesource.com/707557
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Xiaoyin Liu b5807979e8 Use HTTPS links in CheckAuthorizedAuthor
For security and privacy, change http://www.chromium.org/developers/contributing-code
link to use HTTPS.

R=dpranke@chromium.org

Bug:
Change-Id: I12d0658631d7704de1b3072f6eb840814cc6bed0
Reviewed-on: https://chromium-review.googlesource.com/702034
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
8 years ago
Andrew Grieve d86c803715 Fix CheckPatchFormatted() when using inherit-review-settings-ok
Adding inherit-review-settings-ok to a subrepository causes the
PRESUBMIT.py of the parent repository to be run. In this case, the
CheckPatchFormatted() check needs to run "git cl format" with
CWD=repository root.

Bug: 768962

Change-Id: I44c642185efa78ba3a1bd752f94c3c09feff9cf1
Reviewed-on: https://chromium-review.googlesource.com/685355
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
8 years ago
Ilya Sherman e081cbe5aa [git cl format] Pass --presubmit flag when formatting from presubmit.
This allows us to skip 'git cl format' for histograms.xml, which in
turn allows us to issue a presubmit error rather than a warning when
that file is malformatted, without running the formatting code twice.
The formatter is somewhat slow for this file, so it's helpful to avoid
duplicating that work.

BUG=none
TEST=none
R=iannucci@chromium.org

Change-Id: Ia86d45c7c56a9f89db34ca7175ef686589084f85
Reviewed-on: https://chromium-review.googlesource.com/569105
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
8 years ago
Nico Weber c833946a1f Remove const NSObject global presubmit.
I added this when we were moving from gcc to clang on OS X many years
ago.  Now that gcc has been deprecated on mac for many years, this
is safe to remove (clang errors on this pattern).

This check took 0.6s during `git cl presubmit` on a recent change of
mine, so it should speed presubmit up a bit.

Bug: none
Change-Id: Ia29b046807582e056115519fb5b34ee8a1b9ff91
Reviewed-on: https://chromium-review.googlesource.com/553238
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
8 years ago
Aaron Gable fc03e67e9a Refactor PRESUBMIT support for tags
We want PRESUBMIT to be able to equally support
BUG= tags (old style) and Git-Footer: footers
(new style). This change refactors the way that
the presubmit api gives access to those properties
so that it is easier to add support for equivalent
footers.

It also limits the scope of tags/footers that it
exposes, as code search shows no PRESUBMIT files
that take advantage of any of the more esoteric
ones.

Bug: 710327, 710803
Change-Id: I86f1d6cb2e1f0aff9653ef3fb455e0a6f47acf5d
Reviewed-on: https://chromium-review.googlesource.com/506450
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Jochen Eisinger d0573ec067 Use OldContents() for OWNERS files to do checks
BUG=141253
R=dpranke@chromium.org

Change-Id: Iacbc2f0571e725e4f2ccf5ea7878f101972289bb
Reviewed-on: https://chromium-review.googlesource.com/476610
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
8 years ago