From 8142c33170f0c05369eba0bdd4cfaa3077b50b44 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Aug 2022 15:00:38 -0500 Subject: [PATCH 1/2] First pass at implementing 'trait_missing.ron' --- .gitignore | 2 ++ src/queries/trait_missing.ron | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/queries/trait_missing.ron diff --git a/.gitignore b/.gitignore index 6749dfd1..aca14146 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Generated by Cargo # will have compiled files and executables /target/ +*/target/ # These are backup files generated by rustfmt **/*.rs.bk @@ -10,3 +11,4 @@ # local-only data localdata/ + diff --git a/src/queries/trait_missing.ron b/src/queries/trait_missing.ron new file mode 100644 index 00000000..61ee67cb --- /dev/null +++ b/src/queries/trait_missing.ron @@ -0,0 +1,47 @@ +SemverQuery( + id: "trait_missing", + human_readable_name: "pub trait removed or renamed", + description: "A trait can no longer be imported by its prior path", + required_update: Major, + reference_link: Some(""), + query: r#" + { + CrateDiff { + baseline { + item { + ... on Trait { + visibility_limit @filter(op: "=", vlaue: ["$public"]) @output + name @output @tag + + importable_path { + path @output @path + } + + span_: span @optional { + filename @output + begin_line @output + } + } + } + } + current @folkd @transform(op: "count") @filter(op: "=", value: ["$zero"]) { + item { + ... on Trait { + visibility_limit @filter(op: "=", value: ["$public"]) + name @filter(op: "=", value: ["%name"]) + + importable_path { + path @filter(op: "=", value: ["%path"]) + } + } + } + } + } + }"#, + arguments: { + "public": "public", + "zero": 0, + }, + error_message: "", + per_result_error_template: Some(""), +) From cb5739fab0e6db27b1fab72c1dcaed7daa6e7e09 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 31 Aug 2022 16:24:31 -0500 Subject: [PATCH 2/2] Fix typo --- src/queries/trait_missing.ron | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/queries/trait_missing.ron b/src/queries/trait_missing.ron index 61ee67cb..f13f4029 100644 --- a/src/queries/trait_missing.ron +++ b/src/queries/trait_missing.ron @@ -10,7 +10,7 @@ SemverQuery( baseline { item { ... on Trait { - visibility_limit @filter(op: "=", vlaue: ["$public"]) @output + visibility_limit @filter(op: "=", value: ["$public"]) @output name @output @tag importable_path { @@ -24,7 +24,7 @@ SemverQuery( } } } - current @folkd @transform(op: "count") @filter(op: "=", value: ["$zero"]) { + current @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) { item { ... on Trait { visibility_limit @filter(op: "=", value: ["$public"])