cargo-semver-checks 0.13.0

Scan your Rust crate for semver violations.
SemverQuery(
    id: "enum_variant_missing",
    human_readable_name: "pub enum variant removed or renamed",
    description: "An enum variant is no longer available under its prior name.",
    required_update: Major,
    reference_link: Some("https://doc.rust-lang.org/cargo/reference/semver.html#item-remove"),
    query: r#"
    {
        CrateDiff {
            baseline {
                item {
                    ... on Enum {
                        visibility_limit @filter(op: "=", value: ["$public"]) @output
                        enum_name: name @output @tag

                        importable_path {
                            path @output @tag
                        }

                        variant {
                            variant_name: name @output @tag

                            span_: span @optional {
                                filename @output
                                begin_line @output
                            }
                        }
                    }
                }
            }
            current {
                item {
                    ... on Enum {
                        visibility_limit @filter(op: "=", value: ["$public"])
                        name @filter(op: "=", value: ["%enum_name"])

                        importable_path {
                            path @filter(op: "=", value: ["%path"])
                        }

                        variant @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) {
                            name @filter(op: "=", value: ["%variant_name"])
                        }
                    }
                }
            }
        }
    }"#,
    arguments: {
        "public": "public",
        "zero": 0,
    },
    error_message: "A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.",
    per_result_error_template: Some("variant {{enum_name}}::{{variant_name}}, previously in file {{span_filename}}:{{span_begin_line}}"),
)