gecko-dev/servo/python/tidy
Sadman Kazi 2c0f5ecc36 servo: Merge #16366 - Check for merge commits with tidy (from sadmansk:check-merge-commits); r=Wafflespeanut
<!-- Please describe your changes on the following line: -->
Tidy checks the last merge commit and their author and reports an error if the **last merge commit**'s author is not `bors-servo`.

In case the tidy test is run under Travis (checked by looking at the [value of the `TRAVIS` environment variable](https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables), the number of commits looked at from `git log --merges` is two, and the second last merge commit is checked, since, from the [Travis docs](https://docs.travis-ci.com/user/pull-requests/#My-Pull-Request-isn%E2%80%99t-being-built):
> We rely on the merge commit that GitHub transparently creates between the changes in the source branch and the upstream branch the pull request is sent against.

So this is the test that I did:
```
$ git pull upstream master
...
$ git log --merges
commit 8262c109378dfe5452535e77ec6a5eb9f8e82f77
Merge: e2c7e3d1e2 7ba3f1e4f3
Author: Sadman Kazi <sadman@sadmansk.com>
Date:   Wed Apr 12 01:07:30 2017 -0400

    Merge branch 'master' of github.com:servo/servo into check-merge-commits

commit 7ba3f1e4f3064ec3054b2346062758375b8ab117
Merge: 7262270990 90697ab8e6
Author: bors-servo <lbergstrom+bors@mozilla.com>
Date:   Tue Apr 11 22:52:23 2017 -0500

    Auto merge of #16358 - bholley:style_sharing_fixes, r=emilio
...
$ ./mach test-tidy
Checking the config file...
Checking directories for correct file extensions...
:::: no merge commits allowed by authors other than bors-servo
```
Obviously I didn't push the HEAD with the merge commit 😅 , it was just for testing.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix  #15673

<!-- Either: -->
- [X] These changes do not require tests because I'm not really sure how one would go about automating this test

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: ff8e9872ff38327eb269a4d65e4269e5e5d6c9ce

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f9872eade728b90ad249ee861b1fa5f3399ab369
2017-04-13 22:28:50 -05:00
..
servo_tidy servo: Merge #16366 - Check for merge commits with tidy (from sadmansk:check-merge-commits); r=Wafflespeanut 2017-04-13 22:28:50 -05:00
servo_tidy_tests servo: Merge #16150 - Allow using servo as dependency, by fixing Cargo.toml of servo-test-t… (from kdy1997:master); r=jdm 2017-03-27 07:41:36 -07:00
HISTORY.rst servo: Merge #15731 - Update servo-tidy to 0.3.0 (from UK992:tidy); r=Wafflespeanut 2017-02-25 06:41:05 -08:00
Makefile servo: Merge #10653 - Cleanup tidy for external deps (from askeing:cleanup_tidy_for_external_deps); r=edunham 2016-04-19 01:52:01 +05:01
README.rst servo: Merge #15731 - Update servo-tidy to 0.3.0 (from UK992:tidy); r=Wafflespeanut 2017-02-25 06:41:05 -08:00
setup.py servo: Merge #15731 - Update servo-tidy to 0.3.0 (from UK992:tidy); r=Wafflespeanut 2017-02-25 06:41:05 -08:00

servo_tidy
==========

Servo's code and license checker.

Installation
++++++++++++

Install from PyPI:

::

  pip install servo-tidy

or from git:

::

  pip install -e git+https://github.com/servo/servo.git#egg=servo_tidy&subdirectory=python/tidy

To run the tests
++++++++++++++++

::

  ./mach test-tidy --self-test