servo: Merge #12447 - All our Cargo.toml files should contain an MPL-2.0 license field (from asajeffrey:license-mpl-2.0); r=frewsxcv

<!-- Please describe your changes on the following line: -->

Added a `license = "MPL-2.0"` field to all our `Cargo.toml` files, and added a check to `test-tidy` that the license is present.

---
<!-- 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 #12434
- [X] There are tests for these changes

<!-- 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: 650d1d1185eecdc4c8b605bb0290ece7de839015
This commit is contained in:
Alan Jeffrey
2016-07-14 09:33:18 -07:00
parent 9f0f6cf1df
commit 1a348eb9d5
43 changed files with 53 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ import site
import StringIO
import subprocess
import sys
from licenseck import licenses
from licenseck import licenses, licenses_toml
# License and header checks
EMACS_HEADER = "/* -*- Mode:"
@@ -295,9 +295,14 @@ duplicate versions for package "{package}"
def check_toml(file_name, lines):
if not file_name.endswith(".toml"):
raise StopIteration
ok_licensed = False
for idx, line in enumerate(lines):
if line.find("*") != -1:
yield (idx + 1, "found asterisk instead of minimum version number")
for license in licenses_toml:
ok_licensed |= (license in line)
if not ok_licensed:
yield (0, ".toml file should contain a valid license.")
def check_rust(file_name, lines):