| 7 | |
| 8 | |
| 9 | def run_clippy( |
| 10 | variants: List[Variant], |
| 11 | features: Mapping[str, Sequence[str]] | None = None, |
| 12 | target: str | None = None, |
| 13 | fail_on_warn: bool = False, |
| 14 | ): |
| 15 | args = [cargo_cmd_name(), "clippy", "--locked", "--workspace", "--exclude", "zbus", "--exclude", "zbus_names"] |
| 16 | |
| 17 | if target: |
| 18 | args.extend(["--target", target]) |
| 19 | |
| 20 | if Variant.FULL not in variants: |
| 21 | args.extend(["--exclude", DESKTOP_PACKAGE_NAME, "--exclude", DESKTOP_FUZZ_PACKAGE_NAME]) |
| 22 | |
| 23 | if features: |
| 24 | args.extend( |
| 25 | [ |
| 26 | "--features", |
| 27 | ",".join(set(itertools.chain.from_iterable(features.values()))), |
| 28 | ] |
| 29 | ) |
| 30 | |
| 31 | if fail_on_warn: |
| 32 | args.extend(["--", "-D", "warnings"]) |
| 33 | |
| 34 | run_cmd( |
| 35 | args, |
| 36 | env={ |
| 37 | **os.environ, |
| 38 | **rust_env(release=False), |
| 39 | }, |
| 40 | ) |
| 41 | |
| 42 | |
| 43 | def run_cargo_tests( |