mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Allow MIT/Apache-2.0 license as well as MPL-2.0.
This commit is contained in:
parent
62e95c5a61
commit
9fa54af347
2 changed files with 12 additions and 5 deletions
|
@ -82,3 +82,9 @@ licenses = [
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
""",
|
""",
|
||||||
] # noqa: Indicate to flake8 that we do not want to check indentation here
|
] # noqa: Indicate to flake8 that we do not want to check indentation here
|
||||||
|
|
||||||
|
# The valid licenses, in the form we'd expect to see them in a Cargo.toml file.
|
||||||
|
licenses_toml = [
|
||||||
|
'license = "MPL-2.0"',
|
||||||
|
'license = "MIT/Apache-2.0"',
|
||||||
|
]
|
||||||
|
|
|
@ -17,7 +17,7 @@ import site
|
||||||
import StringIO
|
import StringIO
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from licenseck import licenses
|
from licenseck import licenses, licenses_toml
|
||||||
|
|
||||||
# License and header checks
|
# License and header checks
|
||||||
EMACS_HEADER = "/* -*- Mode:"
|
EMACS_HEADER = "/* -*- Mode:"
|
||||||
|
@ -295,13 +295,14 @@ duplicate versions for package "{package}"
|
||||||
def check_toml(file_name, lines):
|
def check_toml(file_name, lines):
|
||||||
if not file_name.endswith(".toml"):
|
if not file_name.endswith(".toml"):
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
mpl_licensed = False
|
ok_licensed = False
|
||||||
for idx, line in enumerate(lines):
|
for idx, line in enumerate(lines):
|
||||||
if line.find("*") != -1:
|
if line.find("*") != -1:
|
||||||
yield (idx + 1, "found asterisk instead of minimum version number")
|
yield (idx + 1, "found asterisk instead of minimum version number")
|
||||||
mpl_licensed |= ('license = "MPL-2.0"' in line)
|
for license in licenses_toml:
|
||||||
if not mpl_licensed:
|
ok_licensed |= (license in line)
|
||||||
yield (0, ".toml file should contain MPL-2.0 license.")
|
if not ok_licensed:
|
||||||
|
yield (0, ".toml file should contain a valid license.")
|
||||||
|
|
||||||
|
|
||||||
def check_rust(file_name, lines):
|
def check_rust(file_name, lines):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue