#!/usr/bin/env python3 """Check one product without compiling the other product's engine or wrapper.""" import argparse import subprocess from plugin_catalog import ROOT, catalog products = catalog() parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--plugin", required=True, choices=products) args = parser.parse_args() product = products[args.plugin] packages = [part for name in product["packages"] for part in ["-p", name]] commands = [ ["cargo", "fmt", *packages, "--", "--check"], ["cargo", "test", *packages, "--locked"], ["cargo", "clippy", *packages, "--all-targets", "--locked", "--", "-D", "warnings"], ["cargo", "fmt", "--manifest-path", product["manifest"], "--", "--check"], # Every product has a fixture in the editor renderer; CI checks its formatting too. ["cargo", "fmt", "--manifest-path", "tools/editor-check/Cargo.toml", "--", "--check"], ["cargo", "test", "--manifest-path", product["manifest"], "--locked"], ["cargo", "clippy", "--manifest-path", product["manifest"], "--all-targets", "--locked", "--", "-D", "warnings"], ] for command in commands: subprocess.run(command, cwd=ROOT, check=True)