Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All our Cargo.toml files should contain an MPL-2.0 license field. #12447

Merged
merged 2 commits into from Jul 14, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Allow MIT/Apache-2.0 license as well as MPL-2.0.

  • Loading branch information
asajeffrey committed Jul 14, 2016
commit 9fa54af34794df663d02634860b8a6586f47f81b
@@ -82,3 +82,9 @@
// except according to those terms.
""",
] # 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 StringIO
import subprocess
import sys
from licenseck import licenses
from licenseck import licenses, licenses_toml

# License and header checks
EMACS_HEADER = "/* -*- Mode:"
@@ -295,13 +295,14 @@ def find_reverse_dependencies(dependency, version, content):
def check_toml(file_name, lines):
if not file_name.endswith(".toml"):
raise StopIteration
mpl_licensed = False
ok_licensed = False
for idx, line in enumerate(lines):
if line.find("*") != -1:
yield (idx + 1, "found asterisk instead of minimum version number")
mpl_licensed |= ('license = "MPL-2.0"' in line)
if not mpl_licensed:
yield (0, ".toml file should contain MPL-2.0 license.")
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):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.