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

An in-memory RNG that shares its file descriptor. #14351

Merged
merged 2 commits into from Jan 5, 2017
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

Added test-tidy check for blocked packages.

  • Loading branch information
asajeffrey committed Jan 5, 2017
commit e3a8e3b7063fd6f421beffdf12942ffc083ef71b
@@ -81,6 +81,27 @@
" accessible to\n// web pages."
]

# Packages which we avoid using in Servo.
# For each blocked package, we can list the exceptions,
# which are packages allowed to use the blocked package.
BLOCKED_PACKAGES = {
"rand": [
"deque",
"gaol",
"ipc-channel",
"num-bigint",
"parking_lot_core",
"phf_generator",
"rayon",
"servo_rand",
"tempdir",
"tempfile",
"uuid",
"websocket",
"ws",
],
}


def is_iter_empty(iterator):
try:
@@ -338,6 +359,20 @@ def find_reverse_dependencies(name, content):
message += "\n\t\t" + name
yield (1, message)

# Check to see if we are transitively using any blocked packages
for package in content.get("package", []):
package_name = package.get("name")
package_version = package.get("version")
for dependency in package.get("dependencies", []):
dependency = dependency.split()
dependency_name = dependency[0]
whitelist = BLOCKED_PACKAGES.get(dependency_name)
if whitelist is not None:
if package_name not in whitelist:
fmt = "Package {} {} depends on blocked package {}."
message = fmt.format(package_name, package_version, dependency_name)
yield (1, message)


def check_toml(file_name, lines):
if not file_name.endswith("Cargo.toml"):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.