From 80264c3b56c2a6e613b57902912ed36c2296dc78 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Thu, 22 Jul 2021 10:03:03 +0200 Subject: [PATCH 01/14] Add `links.rs` for checking and building links --- Cargo.lock | 286 ++++++++++++++++++++++++++++++++++++++++++++- rslib/Cargo.toml | 2 + rslib/src/lib.rs | 1 + rslib/src/links.rs | 122 +++++++++++++++++++ 4 files changed, 409 insertions(+), 2 deletions(-) create mode 100644 rslib/src/links.rs diff --git a/Cargo.lock b/Cargo.lock index 96acc8455..95af5047f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,6 +72,7 @@ dependencies = [ "intl-memoizer", "itertools 0.10.1", "lazy_static", + "linkcheck", "nom 7.0.0-alpha1", "num-integer", "num_enum", @@ -84,7 +85,7 @@ dependencies = [ "pulldown-cmark", "rand 0.8.4", "regex", - "reqwest", + "reqwest 0.11.3", "rusqlite", "scopeguard", "serde", @@ -337,12 +338,39 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "codespan" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3362992a0d9f1dd7c3d0e89e0ab2bb540b7a95fea8cd798090e758fda2899b5e" +dependencies = [ + "codespan-reporting", + "serde", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.1" @@ -398,6 +426,33 @@ dependencies = [ "subtle", ] +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "ctor" version = "0.1.20" @@ -419,6 +474,19 @@ dependencies = [ "syn", ] +[[package]] +name = "derive_more" +version = "0.99.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + [[package]] name = "digest" version = "0.9.0" @@ -449,6 +517,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "dtoa-short" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" + [[package]] name = "either" version = "1.6.1" @@ -692,6 +781,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.4" @@ -1080,6 +1178,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kuchiki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +dependencies = [ + "cssparser", + "html5ever", + "matches", + "selectors", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1116,6 +1226,37 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linkcheck" +version = "0.4.1-alpha.0" +source = "git+https://github.com/ankitects/linkcheck.git?rev=2f20798ce521cc594d510d4e417e76d5eac04d4b#2f20798ce521cc594d510d4e417e76d5eac04d4b" +dependencies = [ + "bytes", + "codespan", + "dunce", + "futures", + "http", + "kuchiki", + "lazy_static", + "linkify", + "log", + "pulldown-cmark", + "regex", + "reqwest 0.11.4", + "serde", + "thiserror", + "url", +] + +[[package]] +name = "linkify" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78d59d732ba6d7eeefc418aab8057dc8e3da4374bd5802ffa95bebc04b4d1dfb" +dependencies = [ + "memchr", +] + [[package]] name = "lock_api" version = "0.4.4" @@ -1482,6 +1623,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + [[package]] name = "petgraph" version = "0.5.1" @@ -1498,7 +1648,9 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ + "phf_macros 0.8.0", "phf_shared 0.8.0", + "proc-macro-hack", ] [[package]] @@ -1507,7 +1659,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ac8b67553a7ca9457ce0e526948cad581819238f4a9d1ea74545851fa24f37" dependencies = [ - "phf_macros", + "phf_macros 0.9.0", "phf_shared 0.9.0", "proc-macro-hack", ] @@ -1542,6 +1694,20 @@ dependencies = [ "rand 0.8.4", ] +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "phf_macros" version = "0.9.0" @@ -1973,6 +2139,40 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "ring" version = "0.16.20" @@ -2017,6 +2217,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver", +] + [[package]] name = "rustls" version = "0.19.1" @@ -2097,6 +2306,44 @@ dependencies = [ "libc", ] +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.126" @@ -2183,6 +2430,16 @@ dependencies = [ "serde", ] +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + [[package]] name = "sha1" version = "0.6.0" @@ -2422,6 +2679,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + [[package]] name = "thiserror" version = "1.0.25" @@ -2496,6 +2759,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "tokio-macros", "winapi", ] @@ -2508,6 +2772,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-macros" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-native-tls" version = "0.3.0" @@ -2611,6 +2886,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + [[package]] name = "unic-char-property" version = "0.9.0" @@ -2763,6 +3044,7 @@ dependencies = [ "idna", "matches", "percent-encoding", + "serde", ] [[package]] diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml index 09b86a38d..068efb38f 100644 --- a/rslib/Cargo.toml +++ b/rslib/Cargo.toml @@ -18,6 +18,8 @@ prost-build = "0.7.0" [dev-dependencies] env_logger = "0.8.4" +linkcheck = { git = "https://github.com/ankitects/linkcheck.git", rev = "2f20798ce521cc594d510d4e417e76d5eac04d4b" } +tokio = { version = "*", features = ["macros"] } [dependencies] # pinned as any changes could invalidate sqlite indexes diff --git a/rslib/src/lib.rs b/rslib/src/lib.rs index bdc34c752..e3ae998c8 100644 --- a/rslib/src/lib.rs +++ b/rslib/src/lib.rs @@ -18,6 +18,7 @@ pub mod error; pub mod findreplace; pub mod i18n; pub mod latex; +pub mod links; pub mod log; mod markdown; pub mod media; diff --git a/rslib/src/links.rs b/rslib/src/links.rs new file mode 100644 index 000000000..872b7f885 --- /dev/null +++ b/rslib/src/links.rs @@ -0,0 +1,122 @@ +// Copyright: Ankitects Pty Ltd and contributors +// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +use strum::{Display, EnumIter, EnumString}; + +static HELP_SITE: &'static str = "https://docs.ankiweb.net/"; + +#[derive(Debug, PartialEq, Clone, Copy, Display, EnumIter, EnumString)] +pub enum HelpPage { + #[strum(serialize = "getting-started#note-types")] + Notetype, + #[strum(serialize = "browsing")] + Browsing, + #[strum(serialize = "browsing#find-and-replace")] + BrowsingFindAndReplace, + #[strum(serialize = "browsing#notes")] + BrowsingNotesMenu, + #[strum(serialize = "studying#keyboard-shortcuts")] + KeyboardShortcuts, + #[strum(serialize = "editing")] + Editing, + #[strum(serialize = "editing#adding-cards-and-notes")] + AddingCardAndNote, + #[strum(serialize = "editing#adding-a-note-type")] + AddingNotetype, + #[strum(serialize = "math#latex")] + Latex, + #[strum(serialize = "preferences")] + Preferences, + #[strum(serialize = "")] + Index, + #[strum(serialize = "templates/intro")] + Templates, + #[strum(serialize = "filtered-decks")] + FilteredDeck, + #[strum(serialize = "importing")] + Importing, + #[strum(serialize = "editing#customizing-fields")] + CustomizingFields, + #[strum(serialize = "deck-options")] + DeckOptions, + #[strum(serialize = "editing#features")] + EditingFeatures, +} + +pub fn help_page_link(page: HelpPage) -> String { + format!("{}{}", HELP_SITE, page) +} + +pub fn help_page_link_from_str(page: &str) -> String { + format!("{}{}", HELP_SITE, page) +} + +#[cfg(test)] +mod test { + use super::*; + + use futures::StreamExt; + use itertools::Itertools; + use linkcheck::{ + validation::{check_web, Context, Reason}, + BasicContext, + }; + use reqwest::Url; + use std::iter; + use strum::IntoEnumIterator; + + /// Aggregates [`Outcome`]s by collecting the error messages of the invalid ones. + #[derive(Default)] + struct Outcomes(Vec); + + enum Outcome { + Valid, + Invalid(String), + } + + #[tokio::test] + async fn check_links() { + let ctx = BasicContext::default(); + let result = futures::stream::iter(HelpPage::iter()) + .map(|page| check_page(page, &ctx)) + .buffer_unordered(ctx.concurrency()) + .collect::() + .await; + if result.0.len() > 0 { + panic!(result.message()); + } + } + + async fn check_page(page: HelpPage, ctx: &BasicContext) -> Outcome { + match Url::parse(&help_page_link(page)) { + Ok(url) => match check_web(&url, ctx).await { + Ok(()) => Outcome::Valid, + Err(Reason::Dom) => { + Outcome::Invalid(format!("'{}' not found on '{}'", page, HELP_SITE)) + } + Err(Reason::Web(err)) => Outcome::Invalid(err.to_string()), + _ => unreachable!(), + }, + Err(err) => Outcome::Invalid(err.to_string()), + } + } + + impl Extend for Outcomes { + fn extend>(&mut self, items: T) { + for outcome in items { + match outcome { + Outcome::Valid => (), + Outcome::Invalid(err) => self.0.push(err), + } + } + } + } + + impl Outcomes { + fn message(&self) -> String { + iter::once(&format!("{} links could not be validated:", self.0.len())) + .chain(self.0.iter()) + .join("\n - ") + } + } +} From 55e1f178eff254871916f8a3e748b0c21bec7119 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Thu, 22 Jul 2021 10:05:38 +0200 Subject: [PATCH 02/14] Add `links.proto` and backend module --- proto/anki/backend.proto | 1 + proto/anki/links.proto | 38 +++++++++++++++++++++++++++++++ rslib/src/backend/links.rs | 46 ++++++++++++++++++++++++++++++++++++++ rslib/src/backend/mod.rs | 3 +++ rslib/src/backend_proto.rs | 1 + 5 files changed, 89 insertions(+) create mode 100644 proto/anki/links.proto create mode 100644 rslib/src/backend/links.rs diff --git a/proto/anki/backend.proto b/proto/anki/backend.proto index b69fb2120..6613737fb 100644 --- a/proto/anki/backend.proto +++ b/proto/anki/backend.proto @@ -24,6 +24,7 @@ enum ServiceIndex { SERVICE_INDEX_I18N = 12; SERVICE_INDEX_COLLECTION = 13; SERVICE_INDEX_CARDS = 14; + SERVICE_INDEX_LINKS = 15; } message BackendInit { diff --git a/proto/anki/links.proto b/proto/anki/links.proto new file mode 100644 index 000000000..da2c567a5 --- /dev/null +++ b/proto/anki/links.proto @@ -0,0 +1,38 @@ +// Copyright: Ankitects Pty Ltd and contributors +// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +syntax = "proto3"; + +package anki.links; + +import "anki/generic.proto"; + +service LinksService { + rpc HelpPageLink(HelpPageLinkRequest) returns (generic.String); +} + +message HelpPageLinkRequest { + enum HelpPage { + NOTE_TYPE = 0; + BROWSING = 1; + BROWSING_FIND_AND_REPLACE = 2; + BROWSING_NOTES_MENU = 3; + KEYBOARD_SHORTCUTS = 4; + EDITING = 5; + ADDING_CARD_AND_NOTE = 6; + ADDING_A_NOTE_TYPE = 7; + LATEX = 8; + PREFERENCES = 9; + INDEX = 10; + TEMPLATES = 11; + FILTERED_DECK = 12; + IMPORTING = 13; + CUSTOMIZING_FIELDS = 14; + DECK_OPTIONS = 15; + EDITING_FEATURES = 16; + } + oneof page { + HelpPage variant = 1; + string literal = 2; + } +} diff --git a/rslib/src/backend/links.rs b/rslib/src/backend/links.rs new file mode 100644 index 000000000..09246db5f --- /dev/null +++ b/rslib/src/backend/links.rs @@ -0,0 +1,46 @@ +// Copyright: Ankitects Pty Ltd and contributors +// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +use super::Backend; +pub(super) use crate::backend_proto::links_service::Service as LinksService; +use crate::{ + backend_proto as pb, + backend_proto::links::help_page_link_request::{HelpPage as ProtoHelpPage, Page}, + links::{help_page_link, help_page_link_from_str, HelpPage}, + prelude::*, +}; + +impl LinksService for Backend { + fn help_page_link(&self, input: pb::HelpPageLinkRequest) -> Result { + Ok(match input.page { + Some(Page::Variant(var)) => help_page_link(var.into()), + Some(Page::Literal(s)) => help_page_link_from_str(&s), + None => help_page_link_from_str(""), + } + .into()) + } +} + +impl From for HelpPage { + fn from(page: i32) -> Self { + match ProtoHelpPage::from_i32(page).unwrap_or(ProtoHelpPage::Index) { + ProtoHelpPage::NoteType => HelpPage::Notetype, + ProtoHelpPage::Browsing => HelpPage::Browsing, + ProtoHelpPage::BrowsingFindAndReplace => HelpPage::BrowsingFindAndReplace, + ProtoHelpPage::BrowsingNotesMenu => HelpPage::BrowsingNotesMenu, + ProtoHelpPage::KeyboardShortcuts => HelpPage::KeyboardShortcuts, + ProtoHelpPage::Editing => HelpPage::Editing, + ProtoHelpPage::AddingCardAndNote => HelpPage::AddingCardAndNote, + ProtoHelpPage::AddingANoteType => HelpPage::AddingNotetype, + ProtoHelpPage::Latex => HelpPage::Latex, + ProtoHelpPage::Preferences => HelpPage::Preferences, + ProtoHelpPage::Index => HelpPage::Index, + ProtoHelpPage::Templates => HelpPage::Templates, + ProtoHelpPage::FilteredDeck => HelpPage::FilteredDeck, + ProtoHelpPage::Importing => HelpPage::Importing, + ProtoHelpPage::CustomizingFields => HelpPage::CustomizingFields, + ProtoHelpPage::DeckOptions => HelpPage::DeckOptions, + ProtoHelpPage::EditingFeatures => HelpPage::EditingFeatures, + } + } +} diff --git a/rslib/src/backend/mod.rs b/rslib/src/backend/mod.rs index 013d5104d..ad1557e8b 100644 --- a/rslib/src/backend/mod.rs +++ b/rslib/src/backend/mod.rs @@ -15,6 +15,7 @@ mod decks; mod error; mod generic; mod i18n; +mod links; mod media; mod notes; mod notetypes; @@ -44,6 +45,7 @@ use self::{ deckconfig::DeckConfigService, decks::DecksService, i18n::I18nService, + links::LinksService, media::MediaService, notes::NotesService, notetypes::NotetypesService, @@ -132,6 +134,7 @@ impl Backend { pb::ServiceIndex::Stats => StatsService::run_method(self, method, input), pb::ServiceIndex::Search => SearchService::run_method(self, method, input), pb::ServiceIndex::I18n => I18nService::run_method(self, method, input), + pb::ServiceIndex::Links => LinksService::run_method(self, method, input), pb::ServiceIndex::Collection => CollectionService::run_method(self, method, input), pb::ServiceIndex::Cards => CardsService::run_method(self, method, input), }) diff --git a/rslib/src/backend_proto.rs b/rslib/src/backend_proto.rs index 0fc6be831..ec9f2da43 100644 --- a/rslib/src/backend_proto.rs +++ b/rslib/src/backend_proto.rs @@ -22,6 +22,7 @@ protobuf!(deckconfig); protobuf!(decks); protobuf!(generic); protobuf!(i18n); +protobuf!(links); protobuf!(media); protobuf!(notes); protobuf!(notetypes); From d8d69a381002078403d66a99781de365b135bc77 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Thu, 22 Jul 2021 10:07:13 +0200 Subject: [PATCH 03/14] Switch frontend to use backend links --- pylib/.pylintrc | 1 + pylib/anki/_backend/genbackend.py | 3 +++ pylib/anki/collection.py | 2 ++ pylib/anki/links_pb2.pyi | 1 + qt/aqt/utils.py | 41 ++++++------------------------- 5 files changed, 14 insertions(+), 34 deletions(-) create mode 100644 pylib/anki/links_pb2.pyi diff --git a/pylib/.pylintrc b/pylib/.pylintrc index 1fc1205de..0bb5dd5b5 100644 --- a/pylib/.pylintrc +++ b/pylib/.pylintrc @@ -6,6 +6,7 @@ persistent = no ignored-classes= BrowserColumns, BrowserRow, + HelpPage, FormatTimespanRequest, CardAnswer, QueuedCards, diff --git a/pylib/anki/_backend/genbackend.py b/pylib/anki/_backend/genbackend.py index b5cb0964a..e8ed939d8 100755 --- a/pylib/anki/_backend/genbackend.py +++ b/pylib/anki/_backend/genbackend.py @@ -14,6 +14,7 @@ import anki.cards_pb2 import anki.collection_pb2 import anki.decks_pb2 import anki.deckconfig_pb2 +import anki.links_pb2 import anki.notes_pb2 import anki.notetypes_pb2 import anki.scheduler_pb2 @@ -195,6 +196,7 @@ service_modules = dict( CARD_RENDERING=anki.card_rendering_pb2, TAGS=anki.tags_pb2, MEDIA=anki.media_pb2, + LINKS=anki.links_pb2, ) for service in anki.backend_pb2.ServiceIndex.DESCRIPTOR.values: @@ -236,6 +238,7 @@ import anki.cards_pb2 import anki.collection_pb2 import anki.decks_pb2 import anki.deckconfig_pb2 +import anki.links_pb2 import anki.notes_pb2 import anki.notetypes_pb2 import anki.scheduler_pb2 diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 757170257..7b4555417 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -12,12 +12,14 @@ from anki import ( collection_pb2, config_pb2, generic_pb2, + links_pb2, search_pb2, stats_pb2, ) from anki._legacy import DeprecatedNamesMixin, deprecated # protobuf we publicly export - listed first to avoid circular imports +HelpPage = links_pb2.HelpPageLinkRequest SearchNode = search_pb2.SearchNode Progress = collection_pb2.Progress EmptyCardsReport = card_rendering_pb2.EmptyCardsReport diff --git a/pylib/anki/links_pb2.pyi b/pylib/anki/links_pb2.pyi new file mode 100644 index 000000000..240954913 --- /dev/null +++ b/pylib/anki/links_pb2.pyi @@ -0,0 +1 @@ +../../bazel-bin/pylib/anki/links_pb2.pyi \ No newline at end of file diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index c6a983408..a6b5052bd 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -34,7 +34,7 @@ from PyQt5.QtWidgets import ( ) import aqt -from anki.collection import Collection +from anki.collection import Collection, HelpPage from anki.lang import TR, tr_legacyglobal # pylint: disable=unused-import from anki.utils import invalidFilename, isMac, isWin, noBundledLibs, versionWithBuild from aqt.qt import * @@ -69,42 +69,15 @@ def locale_dir() -> str: # shortcut to access Fluent translations; set as tr = tr_legacyglobal - -class HelpPage(Enum): - NOTE_TYPE = "getting-started#note-types" - BROWSING = "browsing" - BROWSING_FIND_AND_REPLACE = "browsing#find-and-replace" - BROWSING_NOTES_MENU = "browsing#notes" - KEYBOARD_SHORTCUTS = "studying#keyboard-shortcuts" - EDITING = "editing" - ADDING_CARD_AND_NOTE = "editing#adding-cards-and-notes" - ADDING_A_NOTE_TYPE = "editing#adding-a-note-type" - LATEX = "math#latex" - PREFERENCES = "preferences" - INDEX = "" - TEMPLATES = "templates/intro" - FILTERED_DECK = "filtered-decks" - IMPORTING = "importing" - CUSTOMIZING_FIELDS = "editing#customizing-fields" - DECK_OPTIONS = "deck-options" - EDITING_FEATURES = "editing#features" - - -HelpPageArgument = Optional[Union[HelpPage, str]] -"""This type represents what can be used as argument expecting a specific help page. Anki code should use HelpPage as -argument. However, add-on may use string, and we want to accept this. - -""" +HelpPageArgument = Union["HelpPage.HelpPage.V", str] def openHelp(section: HelpPageArgument) -> None: - link = aqt.appHelpSite - if section: - if isinstance(section, HelpPage): - link += section.value - else: - link += section - openLink(link) + if isinstance(section, str): + page = HelpPage(literal=section) + else: + page = HelpPage(variant=section) + openLink(tr.backend().help_page_link(page)) def openLink(link: Union[str, QUrl]) -> None: From 470312ca87a15eb3f2914d551eacfee374f43dc2 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Thu, 22 Jul 2021 10:08:50 +0200 Subject: [PATCH 04/14] Update proto format call in docs --- docs/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.md b/docs/development.md index e23ff82cc..38ee3061d 100644 --- a/docs/development.md +++ b/docs/development.md @@ -132,7 +132,7 @@ in the relevant package: ``` bazel run //rslib:format bazel run //rslib:sql_format -bazel run //rslib:proto_format +bazel run //proto:format bazel run //pylib:format bazel run //qt:format bazel run //ts:format From f2f19e8b45c882a761cc01c59d13286bada3fb6f Mon Sep 17 00:00:00 2001 From: RumovZ Date: Thu, 22 Jul 2021 16:32:49 +0200 Subject: [PATCH 05/14] Remove native HelpPage enum Also remove oneof from pb enum and handle strs in Python. --- proto/anki/links.proto | 5 +-- qt/aqt/utils.py | 6 +-- rslib/build/protobuf.rs | 4 ++ rslib/src/backend/links.rs | 39 +++---------------- rslib/src/links.rs | 80 +++++++++++++++----------------------- 5 files changed, 45 insertions(+), 89 deletions(-) diff --git a/proto/anki/links.proto b/proto/anki/links.proto index da2c567a5..a8b4f2021 100644 --- a/proto/anki/links.proto +++ b/proto/anki/links.proto @@ -31,8 +31,5 @@ message HelpPageLinkRequest { DECK_OPTIONS = 15; EDITING_FEATURES = 16; } - oneof page { - HelpPage variant = 1; - string literal = 2; - } + HelpPage page = 1; } diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index a6b5052bd..2a307d922 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -74,10 +74,10 @@ HelpPageArgument = Union["HelpPage.HelpPage.V", str] def openHelp(section: HelpPageArgument) -> None: if isinstance(section, str): - page = HelpPage(literal=section) + link = tr.backend().help_page_link(page=HelpPage.INDEX) + section else: - page = HelpPage(variant=section) - openLink(tr.backend().help_page_link(page)) + link = tr.backend().help_page_link(page=section) + openLink(link) def openLink(link: Union[str, QUrl]) -> None: diff --git a/rslib/build/protobuf.rs b/rslib/build/protobuf.rs index 4a48b8880..981f8f239 100644 --- a/rslib/build/protobuf.rs +++ b/rslib/build/protobuf.rs @@ -105,6 +105,10 @@ pub fn write_backend_proto_rs() { "Deck.Filtered.SearchTerm.Order", "#[derive(strum::EnumIter)]", ) + .type_attribute( + "HelpPageLinkRequest.HelpPage", + "#[derive(strum::EnumIter)]", + ) .compile_protos(paths.as_slice(), &[proto_dir]) .unwrap(); } diff --git a/rslib/src/backend/links.rs b/rslib/src/backend/links.rs index 09246db5f..76c5bdc98 100644 --- a/rslib/src/backend/links.rs +++ b/rslib/src/backend/links.rs @@ -4,43 +4,14 @@ use super::Backend; pub(super) use crate::backend_proto::links_service::Service as LinksService; use crate::{ - backend_proto as pb, - backend_proto::links::help_page_link_request::{HelpPage as ProtoHelpPage, Page}, - links::{help_page_link, help_page_link_from_str, HelpPage}, - prelude::*, + backend_proto as pb, backend_proto::links::help_page_link_request::HelpPage, prelude::*, }; impl LinksService for Backend { fn help_page_link(&self, input: pb::HelpPageLinkRequest) -> Result { - Ok(match input.page { - Some(Page::Variant(var)) => help_page_link(var.into()), - Some(Page::Literal(s)) => help_page_link_from_str(&s), - None => help_page_link_from_str(""), - } - .into()) - } -} - -impl From for HelpPage { - fn from(page: i32) -> Self { - match ProtoHelpPage::from_i32(page).unwrap_or(ProtoHelpPage::Index) { - ProtoHelpPage::NoteType => HelpPage::Notetype, - ProtoHelpPage::Browsing => HelpPage::Browsing, - ProtoHelpPage::BrowsingFindAndReplace => HelpPage::BrowsingFindAndReplace, - ProtoHelpPage::BrowsingNotesMenu => HelpPage::BrowsingNotesMenu, - ProtoHelpPage::KeyboardShortcuts => HelpPage::KeyboardShortcuts, - ProtoHelpPage::Editing => HelpPage::Editing, - ProtoHelpPage::AddingCardAndNote => HelpPage::AddingCardAndNote, - ProtoHelpPage::AddingANoteType => HelpPage::AddingNotetype, - ProtoHelpPage::Latex => HelpPage::Latex, - ProtoHelpPage::Preferences => HelpPage::Preferences, - ProtoHelpPage::Index => HelpPage::Index, - ProtoHelpPage::Templates => HelpPage::Templates, - ProtoHelpPage::FilteredDeck => HelpPage::FilteredDeck, - ProtoHelpPage::Importing => HelpPage::Importing, - ProtoHelpPage::CustomizingFields => HelpPage::CustomizingFields, - ProtoHelpPage::DeckOptions => HelpPage::DeckOptions, - ProtoHelpPage::EditingFeatures => HelpPage::EditingFeatures, - } + Ok(HelpPage::from_i32(input.page) + .unwrap_or(HelpPage::Index) + .to_link() + .into()) } } diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 872b7f885..69f125182 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -1,54 +1,36 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -use strum::{Display, EnumIter, EnumString}; +use crate::backend_proto::links::help_page_link_request::HelpPage; static HELP_SITE: &'static str = "https://docs.ankiweb.net/"; -#[derive(Debug, PartialEq, Clone, Copy, Display, EnumIter, EnumString)] -pub enum HelpPage { - #[strum(serialize = "getting-started#note-types")] - Notetype, - #[strum(serialize = "browsing")] - Browsing, - #[strum(serialize = "browsing#find-and-replace")] - BrowsingFindAndReplace, - #[strum(serialize = "browsing#notes")] - BrowsingNotesMenu, - #[strum(serialize = "studying#keyboard-shortcuts")] - KeyboardShortcuts, - #[strum(serialize = "editing")] - Editing, - #[strum(serialize = "editing#adding-cards-and-notes")] - AddingCardAndNote, - #[strum(serialize = "editing#adding-a-note-type")] - AddingNotetype, - #[strum(serialize = "math#latex")] - Latex, - #[strum(serialize = "preferences")] - Preferences, - #[strum(serialize = "")] - Index, - #[strum(serialize = "templates/intro")] - Templates, - #[strum(serialize = "filtered-decks")] - FilteredDeck, - #[strum(serialize = "importing")] - Importing, - #[strum(serialize = "editing#customizing-fields")] - CustomizingFields, - #[strum(serialize = "deck-options")] - DeckOptions, - #[strum(serialize = "editing#features")] - EditingFeatures, -} +impl HelpPage { + pub fn to_link(self) -> String { + format!("{}{}", HELP_SITE, self.to_fragment()) + } -pub fn help_page_link(page: HelpPage) -> String { - format!("{}{}", HELP_SITE, page) -} - -pub fn help_page_link_from_str(page: &str) -> String { - format!("{}{}", HELP_SITE, page) + fn to_fragment(self) -> &'static str { + match self { + HelpPage::NoteType => "getting-started#note-types", + HelpPage::Browsing => "browsing", + HelpPage::BrowsingFindAndReplace => "browsing#find-and-replace", + HelpPage::BrowsingNotesMenu => "browsing#notes", + HelpPage::KeyboardShortcuts => "studying#keyboard-shortcuts", + HelpPage::Editing => "editing", + HelpPage::AddingCardAndNote => "editing#adding-cards-and-notes", + HelpPage::AddingANoteType => "editing#adding-a-note-type", + HelpPage::Latex => "math#latex", + HelpPage::Preferences => "preferences", + HelpPage::Index => "", + HelpPage::Templates => "templates/intro", + HelpPage::FilteredDeck => "filtered-decks", + HelpPage::Importing => "importing", + HelpPage::CustomizingFields => "editing#customizing-fields", + HelpPage::DeckOptions => "deck-options", + HelpPage::EditingFeatures => "editing#features", + } + } } #[cfg(test)] @@ -88,12 +70,14 @@ mod test { } async fn check_page(page: HelpPage, ctx: &BasicContext) -> Outcome { - match Url::parse(&help_page_link(page)) { + match Url::parse(&page.to_link()) { Ok(url) => match check_web(&url, ctx).await { Ok(()) => Outcome::Valid, - Err(Reason::Dom) => { - Outcome::Invalid(format!("'{}' not found on '{}'", page, HELP_SITE)) - } + Err(Reason::Dom) => Outcome::Invalid(format!( + "'{}' not found on '{}'", + page.to_fragment(), + HELP_SITE + )), Err(Reason::Web(err)) => Outcome::Invalid(err.to_string()), _ => unreachable!(), }, From 6ef52726daa3d759abbf8c6a2d6f3c552d61c761 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Fri, 23 Jul 2021 10:32:29 +0200 Subject: [PATCH 06/14] Improve error message for unknown fragment --- rslib/src/links.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 69f125182..9cb1e439d 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -7,10 +7,10 @@ static HELP_SITE: &'static str = "https://docs.ankiweb.net/"; impl HelpPage { pub fn to_link(self) -> String { - format!("{}{}", HELP_SITE, self.to_fragment()) + format!("{}{}", HELP_SITE, self.to_link_suffix()) } - fn to_fragment(self) -> &'static str { + fn to_link_suffix(self) -> &'static str { match self { HelpPage::NoteType => "getting-started#note-types", HelpPage::Browsing => "browsing", @@ -74,9 +74,10 @@ mod test { Ok(url) => match check_web(&url, ctx).await { Ok(()) => Outcome::Valid, Err(Reason::Dom) => Outcome::Invalid(format!( - "'{}' not found on '{}'", - page.to_fragment(), - HELP_SITE + "'#{}' not found on '{}{}'", + url.fragment().unwrap(), + url.domain().unwrap(), + url.path(), )), Err(Reason::Web(err)) => Outcome::Invalid(err.to_string()), _ => unreachable!(), @@ -98,7 +99,7 @@ mod test { impl Outcomes { fn message(&self) -> String { - iter::once(&format!("{} links could not be validated:", self.0.len())) + iter::once(&format!("{} link(s) could not be validated:", self.0.len())) .chain(self.0.iter()) .join("\n - ") } From 503bdb8c224bc9be2e4c7078be073a92ef12515e Mon Sep 17 00:00:00 2001 From: RumovZ Date: Fri, 23 Jul 2021 11:44:19 +0200 Subject: [PATCH 07/14] Add check to ensure parsed URL equals link --- rslib/src/links.rs | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 9cb1e439d..19d146bcb 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -70,18 +70,28 @@ mod test { } async fn check_page(page: HelpPage, ctx: &BasicContext) -> Outcome { - match Url::parse(&page.to_link()) { - Ok(url) => match check_web(&url, ctx).await { - Ok(()) => Outcome::Valid, - Err(Reason::Dom) => Outcome::Invalid(format!( - "'#{}' not found on '{}{}'", - url.fragment().unwrap(), - url.domain().unwrap(), - url.path(), - )), - Err(Reason::Web(err)) => Outcome::Invalid(err.to_string()), - _ => unreachable!(), - }, + let link = page.to_link(); + match Url::parse(&link) { + Ok(url) => { + if url.as_str() == link { + match check_web(&url, ctx).await { + Ok(()) => Outcome::Valid, + Err(Reason::Dom) => Outcome::Invalid(format!( + "'#{}' not found on '{}{}'", + url.fragment().unwrap(), + url.domain().unwrap(), + url.path(), + )), + Err(Reason::Web(err)) => Outcome::Invalid(err.to_string()), + _ => unreachable!(), + } + } else { + Outcome::Invalid(format!( + "'{}' is not a valid URL part", + page.to_link_suffix(), + )) + } + } Err(err) => Outcome::Invalid(err.to_string()), } } From 379694915e2cdd098873f6eeea92c1be713149b5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 19:39:40 +1000 Subject: [PATCH 08/14] add linkcheck to Bazel --- Cargo.toml | 4 + cargo/crates.bzl | 240 ++++++++++++++++++ cargo/licenses.json | 216 ++++++++++++++++ cargo/remote/BUILD.codespan-0.11.1.bazel | 57 +++++ .../BUILD.codespan-reporting-0.11.1.bazel | 70 +++++ cargo/remote/BUILD.convert_case-0.4.0.bazel | 53 ++++ cargo/remote/BUILD.cssparser-0.27.2.bazel | 94 +++++++ .../remote/BUILD.cssparser-macros-0.6.0.bazel | 55 ++++ cargo/remote/BUILD.derive_more-0.99.16.bazel | 137 ++++++++++ cargo/remote/BUILD.dtoa-0.4.8.bazel | 57 +++++ cargo/remote/BUILD.dtoa-short-0.3.3.bazel | 54 ++++ cargo/remote/BUILD.dunce-1.0.2.bazel | 53 ++++ cargo/remote/BUILD.fxhash-0.2.1.bazel | 56 ++++ cargo/remote/BUILD.kuchiki-0.8.1.bazel | 61 +++++ .../BUILD.linkcheck-0.4.1-alpha.0.bazel | 71 ++++++ cargo/remote/BUILD.linkify-0.5.0.bazel | 62 +++++ cargo/remote/BUILD.nodrop-0.1.14.bazel | 2 + cargo/remote/BUILD.pest-2.1.3.bazel | 60 +++++ cargo/remote/BUILD.phf-0.8.0.bazel | 7 + cargo/remote/BUILD.phf_macros-0.8.0.bazel | 67 +++++ cargo/remote/BUILD.reqwest-0.11.4.bazel | 139 ++++++++++ cargo/remote/BUILD.rustc_version-0.3.3.bazel | 56 ++++ cargo/remote/BUILD.selectors-0.22.0.bazel | 97 +++++++ cargo/remote/BUILD.semver-0.11.0.bazel | 61 +++++ cargo/remote/BUILD.semver-parser-0.10.2.bazel | 81 ++++++ cargo/remote/BUILD.serde-1.0.126.bazel | 2 + cargo/remote/BUILD.servo_arc-0.1.1.bazel | 55 ++++ cargo/remote/BUILD.thin-slice-0.1.1.bazel | 53 ++++ cargo/remote/BUILD.tokio-1.7.1.bazel | 7 + cargo/remote/BUILD.tokio-macros-1.3.0.bazel | 56 ++++ cargo/remote/BUILD.ucd-trie-0.1.3.bazel | 57 +++++ cargo/remote/BUILD.url-2.2.2.bazel | 2 + cargo/update.py | 3 +- rslib/BUILD.bazel | 3 +- rslib/cargo/BUILD.bazel | 9 + 35 files changed, 2155 insertions(+), 2 deletions(-) create mode 100644 cargo/remote/BUILD.codespan-0.11.1.bazel create mode 100644 cargo/remote/BUILD.codespan-reporting-0.11.1.bazel create mode 100644 cargo/remote/BUILD.convert_case-0.4.0.bazel create mode 100644 cargo/remote/BUILD.cssparser-0.27.2.bazel create mode 100644 cargo/remote/BUILD.cssparser-macros-0.6.0.bazel create mode 100644 cargo/remote/BUILD.derive_more-0.99.16.bazel create mode 100644 cargo/remote/BUILD.dtoa-0.4.8.bazel create mode 100644 cargo/remote/BUILD.dtoa-short-0.3.3.bazel create mode 100644 cargo/remote/BUILD.dunce-1.0.2.bazel create mode 100644 cargo/remote/BUILD.fxhash-0.2.1.bazel create mode 100644 cargo/remote/BUILD.kuchiki-0.8.1.bazel create mode 100644 cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel create mode 100644 cargo/remote/BUILD.linkify-0.5.0.bazel create mode 100644 cargo/remote/BUILD.pest-2.1.3.bazel create mode 100644 cargo/remote/BUILD.phf_macros-0.8.0.bazel create mode 100644 cargo/remote/BUILD.reqwest-0.11.4.bazel create mode 100644 cargo/remote/BUILD.rustc_version-0.3.3.bazel create mode 100644 cargo/remote/BUILD.selectors-0.22.0.bazel create mode 100644 cargo/remote/BUILD.semver-0.11.0.bazel create mode 100644 cargo/remote/BUILD.semver-parser-0.10.2.bazel create mode 100644 cargo/remote/BUILD.servo_arc-0.1.1.bazel create mode 100644 cargo/remote/BUILD.thin-slice-0.1.1.bazel create mode 100644 cargo/remote/BUILD.tokio-macros-1.3.0.bazel create mode 100644 cargo/remote/BUILD.ucd-trie-0.1.3.bazel diff --git a/Cargo.toml b/Cargo.toml index 2bbe4b86a..e5a0afc4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,3 +45,7 @@ compile_data_attr = "glob([\"**/*.rsv\"])" [package.metadata.raze.crates.unic-ucd-category.'*'] compile_data_attr = "glob([\"**/*.rsv\"])" + + +[patch.crates-io] +reqwest = { git="https://github.com/ankitects/reqwest.git", rev="7591444614de02b658ddab125efba7b2bb4e2335" } diff --git a/cargo/crates.bzl b/cargo/crates.bzl index e4e255bec..1352a1260 100644 --- a/cargo/crates.bzl +++ b/cargo/crates.bzl @@ -301,6 +301,26 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.coarsetime-0.1.19.bazel"), ) + maybe( + http_archive, + name = "raze__codespan__0_11_1", + url = "https://crates.io/api/v1/crates/codespan/0.11.1/download", + type = "tar.gz", + sha256 = "3362992a0d9f1dd7c3d0e89e0ab2bb540b7a95fea8cd798090e758fda2899b5e", + strip_prefix = "codespan-0.11.1", + build_file = Label("//cargo/remote:BUILD.codespan-0.11.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__codespan_reporting__0_11_1", + url = "https://crates.io/api/v1/crates/codespan-reporting/0.11.1/download", + type = "tar.gz", + sha256 = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e", + strip_prefix = "codespan-reporting-0.11.1", + build_file = Label("//cargo/remote:BUILD.codespan-reporting-0.11.1.bazel"), + ) + maybe( http_archive, name = "raze__constant_time_eq__0_1_5", @@ -311,6 +331,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.constant_time_eq-0.1.5.bazel"), ) + maybe( + http_archive, + name = "raze__convert_case__0_4_0", + url = "https://crates.io/api/v1/crates/convert_case/0.4.0/download", + type = "tar.gz", + sha256 = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e", + strip_prefix = "convert_case-0.4.0", + build_file = Label("//cargo/remote:BUILD.convert_case-0.4.0.bazel"), + ) + maybe( http_archive, name = "raze__core_foundation__0_9_1", @@ -371,6 +401,26 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.crypto-mac-0.8.0.bazel"), ) + maybe( + http_archive, + name = "raze__cssparser__0_27_2", + url = "https://crates.io/api/v1/crates/cssparser/0.27.2/download", + type = "tar.gz", + sha256 = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a", + strip_prefix = "cssparser-0.27.2", + build_file = Label("//cargo/remote:BUILD.cssparser-0.27.2.bazel"), + ) + + maybe( + http_archive, + name = "raze__cssparser_macros__0_6_0", + url = "https://crates.io/api/v1/crates/cssparser-macros/0.6.0/download", + type = "tar.gz", + sha256 = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e", + strip_prefix = "cssparser-macros-0.6.0", + build_file = Label("//cargo/remote:BUILD.cssparser-macros-0.6.0.bazel"), + ) + maybe( http_archive, name = "raze__ctor__0_1_20", @@ -391,6 +441,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.derivative-2.2.0.bazel"), ) + maybe( + http_archive, + name = "raze__derive_more__0_99_16", + url = "https://crates.io/api/v1/crates/derive_more/0.99.16/download", + type = "tar.gz", + sha256 = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df", + strip_prefix = "derive_more-0.99.16", + build_file = Label("//cargo/remote:BUILD.derive_more-0.99.16.bazel"), + ) + maybe( http_archive, name = "raze__digest__0_9_0", @@ -421,6 +481,36 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.dirs-sys-0.3.6.bazel"), ) + maybe( + http_archive, + name = "raze__dtoa__0_4_8", + url = "https://crates.io/api/v1/crates/dtoa/0.4.8/download", + type = "tar.gz", + sha256 = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0", + strip_prefix = "dtoa-0.4.8", + build_file = Label("//cargo/remote:BUILD.dtoa-0.4.8.bazel"), + ) + + maybe( + http_archive, + name = "raze__dtoa_short__0_3_3", + url = "https://crates.io/api/v1/crates/dtoa-short/0.3.3/download", + type = "tar.gz", + sha256 = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6", + strip_prefix = "dtoa-short-0.3.3", + build_file = Label("//cargo/remote:BUILD.dtoa-short-0.3.3.bazel"), + ) + + maybe( + http_archive, + name = "raze__dunce__1_0_2", + url = "https://crates.io/api/v1/crates/dunce/1.0.2/download", + type = "tar.gz", + sha256 = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541", + strip_prefix = "dunce-1.0.2", + build_file = Label("//cargo/remote:BUILD.dunce-1.0.2.bazel"), + ) + maybe( http_archive, name = "raze__either__1_6_1", @@ -681,6 +771,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.futures-util-0.3.15.bazel"), ) + maybe( + http_archive, + name = "raze__fxhash__0_2_1", + url = "https://crates.io/api/v1/crates/fxhash/0.2.1/download", + type = "tar.gz", + sha256 = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c", + strip_prefix = "fxhash-0.2.1", + build_file = Label("//cargo/remote:BUILD.fxhash-0.2.1.bazel"), + ) + maybe( http_archive, name = "raze__generic_array__0_14_4", @@ -1071,6 +1171,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.js-sys-0.3.51.bazel"), ) + maybe( + http_archive, + name = "raze__kuchiki__0_8_1", + url = "https://crates.io/api/v1/crates/kuchiki/0.8.1/download", + type = "tar.gz", + sha256 = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358", + strip_prefix = "kuchiki-0.8.1", + build_file = Label("//cargo/remote:BUILD.kuchiki-0.8.1.bazel"), + ) + maybe( http_archive, name = "raze__lazy_static__1_4_0", @@ -1111,6 +1221,26 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.libsqlite3-sys-0.22.2.bazel"), ) + maybe( + new_git_repository, + name = "raze__linkcheck__0_4_1_alpha_0", + remote = "https://github.com/ankitects/linkcheck.git", + shallow_since = "1626729019 +0200", + commit = "2f20798ce521cc594d510d4e417e76d5eac04d4b", + build_file = Label("//cargo/remote:BUILD.linkcheck-0.4.1-alpha.0.bazel"), + init_submodules = True, + ) + + maybe( + http_archive, + name = "raze__linkify__0_5_0", + url = "https://crates.io/api/v1/crates/linkify/0.5.0/download", + type = "tar.gz", + sha256 = "78d59d732ba6d7eeefc418aab8057dc8e3da4374bd5802ffa95bebc04b4d1dfb", + strip_prefix = "linkify-0.5.0", + build_file = Label("//cargo/remote:BUILD.linkify-0.5.0.bazel"), + ) + maybe( http_archive, name = "raze__lock_api__0_4_4", @@ -1491,6 +1621,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.percent-encoding-2.1.0.bazel"), ) + maybe( + http_archive, + name = "raze__pest__2_1_3", + url = "https://crates.io/api/v1/crates/pest/2.1.3/download", + type = "tar.gz", + sha256 = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53", + strip_prefix = "pest-2.1.3", + build_file = Label("//cargo/remote:BUILD.pest-2.1.3.bazel"), + ) + maybe( http_archive, name = "raze__petgraph__0_5_1", @@ -1551,6 +1691,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.phf_generator-0.9.0.bazel"), ) + maybe( + http_archive, + name = "raze__phf_macros__0_8_0", + url = "https://crates.io/api/v1/crates/phf_macros/0.8.0/download", + type = "tar.gz", + sha256 = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c", + strip_prefix = "phf_macros-0.8.0", + build_file = Label("//cargo/remote:BUILD.phf_macros-0.8.0.bazel"), + ) + maybe( http_archive, name = "raze__phf_macros__0_9_0", @@ -1961,6 +2111,16 @@ def raze_fetch_remote_crates(): init_submodules = True, ) + maybe( + http_archive, + name = "raze__reqwest__0_11_4", + url = "https://crates.io/api/v1/crates/reqwest/0.11.4/download", + type = "tar.gz", + sha256 = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22", + strip_prefix = "reqwest-0.11.4", + build_file = Label("//cargo:BUILD.reqwest.native.bazel"), + ) + maybe( http_archive, name = "raze__ring__0_16_20", @@ -1991,6 +2151,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.rustc-hash-1.1.0.bazel"), ) + maybe( + http_archive, + name = "raze__rustc_version__0_3_3", + url = "https://crates.io/api/v1/crates/rustc_version/0.3.3/download", + type = "tar.gz", + sha256 = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee", + strip_prefix = "rustc_version-0.3.3", + build_file = Label("//cargo/remote:BUILD.rustc_version-0.3.3.bazel"), + ) + maybe( http_archive, name = "raze__rustls__0_19_1", @@ -2071,6 +2241,36 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.security-framework-sys-2.3.0.bazel"), ) + maybe( + http_archive, + name = "raze__selectors__0_22_0", + url = "https://crates.io/api/v1/crates/selectors/0.22.0/download", + type = "tar.gz", + sha256 = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe", + strip_prefix = "selectors-0.22.0", + build_file = Label("//cargo/remote:BUILD.selectors-0.22.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__semver__0_11_0", + url = "https://crates.io/api/v1/crates/semver/0.11.0/download", + type = "tar.gz", + sha256 = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6", + strip_prefix = "semver-0.11.0", + build_file = Label("//cargo/remote:BUILD.semver-0.11.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__semver_parser__0_10_2", + url = "https://crates.io/api/v1/crates/semver-parser/0.10.2/download", + type = "tar.gz", + sha256 = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7", + strip_prefix = "semver-parser-0.10.2", + build_file = Label("//cargo/remote:BUILD.semver-parser-0.10.2.bazel"), + ) + maybe( http_archive, name = "raze__serde__1_0_126", @@ -2151,6 +2351,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.serde_urlencoded-0.7.0.bazel"), ) + maybe( + http_archive, + name = "raze__servo_arc__0_1_1", + url = "https://crates.io/api/v1/crates/servo_arc/0.1.1/download", + type = "tar.gz", + sha256 = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432", + strip_prefix = "servo_arc-0.1.1", + build_file = Label("//cargo/remote:BUILD.servo_arc-0.1.1.bazel"), + ) + maybe( http_archive, name = "raze__sha1__0_6_0", @@ -2411,6 +2621,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.termcolor-1.1.2.bazel"), ) + maybe( + http_archive, + name = "raze__thin_slice__0_1_1", + url = "https://crates.io/api/v1/crates/thin-slice/0.1.1/download", + type = "tar.gz", + sha256 = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c", + strip_prefix = "thin-slice-0.1.1", + build_file = Label("//cargo/remote:BUILD.thin-slice-0.1.1.bazel"), + ) + maybe( http_archive, name = "raze__thiserror__1_0_25", @@ -2501,6 +2721,16 @@ def raze_fetch_remote_crates(): init_submodules = True, ) + maybe( + http_archive, + name = "raze__tokio_macros__1_3_0", + url = "https://crates.io/api/v1/crates/tokio-macros/1.3.0/download", + type = "tar.gz", + sha256 = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110", + strip_prefix = "tokio-macros-1.3.0", + build_file = Label("//cargo/remote:BUILD.tokio-macros-1.3.0.bazel"), + ) + maybe( http_archive, name = "raze__tokio_native_tls__0_3_0", @@ -2611,6 +2841,16 @@ def raze_fetch_remote_crates(): build_file = Label("//cargo/remote:BUILD.typenum-1.13.0.bazel"), ) + maybe( + http_archive, + name = "raze__ucd_trie__0_1_3", + url = "https://crates.io/api/v1/crates/ucd-trie/0.1.3/download", + type = "tar.gz", + sha256 = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c", + strip_prefix = "ucd-trie-0.1.3", + build_file = Label("//cargo/remote:BUILD.ucd-trie-0.1.3.bazel"), + ) + maybe( http_archive, name = "raze__unic_char_property__0_9_0", diff --git a/cargo/licenses.json b/cargo/licenses.json index 3ac309e3f..fbc886589 100644 --- a/cargo/licenses.json +++ b/cargo/licenses.json @@ -287,6 +287,24 @@ "license_file": null, "description": "Time and duration crate optimized for speed" }, + { + "name": "codespan", + "version": "0.11.1", + "authors": "Brendan Zabarauskas ", + "repository": "https://github.com/brendanzab/codespan", + "license": "Apache-2.0", + "license_file": null, + "description": "Data structures for tracking locations in source code" + }, + { + "name": "codespan-reporting", + "version": "0.11.1", + "authors": "Brendan Zabarauskas ", + "repository": "https://github.com/brendanzab/codespan", + "license": "Apache-2.0", + "license_file": null, + "description": "Beautiful diagnostic reporting for text-based programming languages" + }, { "name": "constant_time_eq", "version": "0.1.5", @@ -296,6 +314,15 @@ "license_file": null, "description": "Compares two equal-sized byte strings in constant time." }, + { + "name": "convert_case", + "version": "0.4.0", + "authors": "David Purdum ", + "repository": "https://github.com/rutrum/convert-case", + "license": "MIT", + "license_file": null, + "description": "Convert strings into any case" + }, { "name": "core-foundation", "version": "0.9.1", @@ -350,6 +377,24 @@ "license_file": null, "description": "Trait for Message Authentication Code (MAC) algorithms" }, + { + "name": "cssparser", + "version": "0.27.2", + "authors": "Simon Sapin ", + "repository": "https://github.com/servo/rust-cssparser", + "license": "MPL-2.0", + "license_file": null, + "description": "Rust implementation of CSS Syntax Level 3" + }, + { + "name": "cssparser-macros", + "version": "0.6.0", + "authors": "Simon Sapin ", + "repository": "https://github.com/servo/rust-cssparser", + "license": "MPL-2.0", + "license_file": null, + "description": "Procedural macros for cssparser" + }, { "name": "ctor", "version": "0.1.20", @@ -368,6 +413,15 @@ "license_file": null, "description": "A set of alternative `derive` attributes for Rust" }, + { + "name": "derive_more", + "version": "0.99.16", + "authors": "Jelte Fennema ", + "repository": "https://github.com/JelteF/derive_more", + "license": "MIT", + "license_file": null, + "description": "Adds #[derive(x)] macros for more traits" + }, { "name": "digest", "version": "0.9.0", @@ -395,6 +449,33 @@ "license_file": null, "description": "System-level helper functions for the dirs and directories crates." }, + { + "name": "dtoa", + "version": "0.4.8", + "authors": "David Tolnay ", + "repository": "https://github.com/dtolnay/dtoa", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "Fast functions for printing floating-point primitives to an io::Write" + }, + { + "name": "dtoa-short", + "version": "0.3.3", + "authors": "Xidorn Quan ", + "repository": "https://github.com/upsuper/dtoa-short", + "license": "MPL-2.0", + "license_file": null, + "description": "Serialize float number and truncate to certain precision" + }, + { + "name": "dunce", + "version": "1.0.2", + "authors": "Kornel ", + "repository": "https://gitlab.com/kornelski/dunce", + "license": "CC0-1.0", + "license_file": null, + "description": "Normalize Windows paths to the most compatible format, avoiding UNC where possible" + }, { "name": "either", "version": "1.6.1", @@ -629,6 +710,15 @@ "license_file": null, "description": "Common utilities and extension traits for the futures-rs library." }, + { + "name": "fxhash", + "version": "0.2.1", + "authors": "cbreeden ", + "repository": "https://github.com/cbreeden/fxhash", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "A fast, non-secure, hashing algorithm derived from an internal hasher used in FireFox and Rustc." + }, { "name": "generic-array", "version": "0.14.4", @@ -980,6 +1070,15 @@ "license_file": null, "description": "Bindings for all JS global objects and functions in all JS environments like Node.js and browsers, built on `#[wasm_bindgen]` using the `wasm-bindgen` crate." }, + { + "name": "kuchiki", + "version": "0.8.1", + "authors": "Simon Sapin ", + "repository": "https://github.com/SimonSapin/kuchiki", + "license": "MIT", + "license_file": null, + "description": "(朽木) HTML/XML tree manipulation library" + }, { "name": "lazy_static", "version": "1.4.0", @@ -1016,6 +1115,24 @@ "license_file": null, "description": "Native bindings to the libsqlite3 library" }, + { + "name": "linkcheck", + "version": "0.4.1-alpha.0", + "authors": "Michael-F-Bryan ", + "repository": "https://github.com/Michael-F-Bryan/linkcheck", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "A library for extracting and validating links." + }, + { + "name": "linkify", + "version": "0.5.0", + "authors": "Robin Stocker ", + "repository": "https://github.com/robinst/linkify", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "Finds URLs and email addresses in plain text. Takes care to get the boundaries right with surrounding punctuation like parentheses." + }, { "name": "lock_api", "version": "0.4.4", @@ -1358,6 +1475,15 @@ "license_file": null, "description": "Percent encoding and decoding" }, + { + "name": "pest", + "version": "2.1.3", + "authors": "Dragoș Tiselice ", + "repository": "https://github.com/pest-parser/pest", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "The Elegant Parser" + }, { "name": "petgraph", "version": "0.5.1", @@ -1412,6 +1538,15 @@ "license_file": null, "description": "PHF generation logic" }, + { + "name": "phf_macros", + "version": "0.8.0", + "authors": "Steven Fackler ", + "repository": "https://github.com/sfackler/rust-phf", + "license": "MIT", + "license_file": null, + "description": "Macros to generate types in the phf crate" + }, { "name": "phf_macros", "version": "0.9.0", @@ -1781,6 +1916,15 @@ "license_file": null, "description": "higher level HTTP client library" }, + { + "name": "reqwest", + "version": "0.11.4", + "authors": "Sean McArthur ", + "repository": "https://github.com/seanmonstar/reqwest", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "higher level HTTP client library" + }, { "name": "ring", "version": "0.16.20", @@ -1817,6 +1961,15 @@ "license_file": null, "description": "speed, non-cryptographic hash used in rustc" }, + { + "name": "rustc_version", + "version": "0.3.3", + "authors": "Marvin Löbel ", + "repository": "https://github.com/Kimundi/rustc-version-rs", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "A library for querying the version of a installed rustc compiler" + }, { "name": "rustls", "version": "0.19.1", @@ -1889,6 +2042,33 @@ "license_file": null, "description": "Apple `Security.framework` low-level FFI bindings" }, + { + "name": "selectors", + "version": "0.22.0", + "authors": "The Servo Project Developers", + "repository": "https://github.com/servo/servo", + "license": "MPL-2.0", + "license_file": null, + "description": "CSS Selectors matching for Rust" + }, + { + "name": "semver", + "version": "0.11.0", + "authors": "Steve Klabnik |The Rust Project Developers", + "repository": "https://github.com/steveklabnik/semver", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "Semantic version parsing and comparison." + }, + { + "name": "semver-parser", + "version": "0.10.2", + "authors": "Steve Klabnik ", + "repository": "https://github.com/steveklabnik/semver-parser", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "Parsing of the semver spec." + }, { "name": "serde", "version": "1.0.126", @@ -1961,6 +2141,15 @@ "license_file": null, "description": "`x-www-form-urlencoded` meets Serde" }, + { + "name": "servo_arc", + "version": "0.1.1", + "authors": "The Servo Project Developers", + "repository": "https://github.com/servo/servo", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "A fork of std::sync::Arc with some extra functionality and without weak references" + }, { "name": "sha1", "version": "0.6.0", @@ -2195,6 +2384,15 @@ "license_file": null, "description": "A simple cross platform library for writing colored text to a terminal." }, + { + "name": "thin-slice", + "version": "0.1.1", + "authors": "Cameron McCormack ", + "repository": "https://github.com/heycam/thin-slice", + "license": "MPL-2.0", + "license_file": null, + "description": "An owned slice that packs the slice storage into a single word when possible" + }, { "name": "thiserror", "version": "1.0.25", @@ -2276,6 +2474,15 @@ "license_file": null, "description": "Tokio wrappers which apply timeouts to IO operations" }, + { + "name": "tokio-macros", + "version": "1.3.0", + "authors": "Tokio Contributors ", + "repository": "https://github.com/tokio-rs/tokio", + "license": "MIT", + "license_file": null, + "description": "Tokio's proc macros." + }, { "name": "tokio-native-tls", "version": "0.3.0", @@ -2375,6 +2582,15 @@ "license_file": null, "description": "Typenum is a Rust library for type-level numbers evaluated at compile time. It currently supports bits, unsigned integers, and signed integers. It also provides a type-level array of type-level numbers, but its implementation is incomplete." }, + { + "name": "ucd-trie", + "version": "0.1.3", + "authors": "Andrew Gallant ", + "repository": "https://github.com/BurntSushi/ucd-generate", + "license": "Apache-2.0 OR MIT", + "license_file": null, + "description": "A trie for storing Unicode codepoint sets and maps." + }, { "name": "unic-char-property", "version": "0.9.0", diff --git a/cargo/remote/BUILD.codespan-0.11.1.bazel b/cargo/remote/BUILD.codespan-0.11.1.bazel new file mode 100644 index 000000000..b82d63821 --- /dev/null +++ b/cargo/remote/BUILD.codespan-0.11.1.bazel @@ -0,0 +1,57 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "codespan", + srcs = glob(["**/*.rs"]), + crate_features = [ + "serde", + "serialization", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.11.1", + # buildifier: leave-alone + deps = [ + "@raze__codespan_reporting__0_11_1//:codespan_reporting", + "@raze__serde__1_0_126//:serde", + ], +) diff --git a/cargo/remote/BUILD.codespan-reporting-0.11.1.bazel b/cargo/remote/BUILD.codespan-reporting-0.11.1.bazel new file mode 100644 index 000000000..92d315c75 --- /dev/null +++ b/cargo/remote/BUILD.codespan-reporting-0.11.1.bazel @@ -0,0 +1,70 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "custom_files" with type "example" omitted + +# Unsupported target "peg_calculator" with type "example" omitted + +# Unsupported target "readme_preview" with type "example" omitted + +# Unsupported target "reusable_diagnostic" with type "example" omitted + +# Unsupported target "term" with type "example" omitted + +rust_library( + name = "codespan_reporting", + srcs = glob(["**/*.rs"]), + crate_features = [ + "serde", + "serialization", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.11.1", + # buildifier: leave-alone + deps = [ + "@raze__serde__1_0_126//:serde", + "@raze__termcolor__1_1_2//:termcolor", + "@raze__unicode_width__0_1_8//:unicode_width", + ], +) + +# Unsupported target "term" with type "test" omitted diff --git a/cargo/remote/BUILD.convert_case-0.4.0.bazel b/cargo/remote/BUILD.convert_case-0.4.0.bazel new file mode 100644 index 000000000..d75e4bd1a --- /dev/null +++ b/cargo/remote/BUILD.convert_case-0.4.0.bazel @@ -0,0 +1,53 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +rust_library( + name = "convert_case", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/cargo/remote/BUILD.cssparser-0.27.2.bazel b/cargo/remote/BUILD.cssparser-0.27.2.bazel new file mode 100644 index 000000000..d26150eff --- /dev/null +++ b/cargo/remote/BUILD.cssparser-0.27.2.bazel @@ -0,0 +1,94 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "reciprocal", # MPL-2.0 from expression "MPL-2.0" +]) + +# Generated Targets +# buildifier: disable=out-of-order-load +# buildifier: disable=load-on-top +load( + "@rules_rust//cargo:cargo_build_script.bzl", + "cargo_build_script", +) + +cargo_build_script( + name = "cssparser_build_script", + srcs = glob(["**/*.rs"]), + build_script_env = { + }, + crate_features = [ + ], + crate_root = "build.rs", + data = glob(["**"]), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.27.2", + visibility = ["//visibility:private"], + deps = [ + "@raze__proc_macro2__1_0_27//:proc_macro2", + "@raze__quote__1_0_9//:quote", + "@raze__syn__1_0_73//:syn", + ], +) + +rust_library( + name = "cssparser", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + proc_macro_deps = [ + "@raze__cssparser_macros__0_6_0//:cssparser_macros", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.27.2", + # buildifier: leave-alone + deps = [ + ":cssparser_build_script", + "@raze__dtoa_short__0_3_3//:dtoa_short", + "@raze__itoa__0_4_7//:itoa", + "@raze__matches__0_1_8//:matches", + "@raze__phf__0_8_0//:phf", + "@raze__smallvec__1_6_1//:smallvec", + ], +) diff --git a/cargo/remote/BUILD.cssparser-macros-0.6.0.bazel b/cargo/remote/BUILD.cssparser-macros-0.6.0.bazel new file mode 100644 index 000000000..29f054443 --- /dev/null +++ b/cargo/remote/BUILD.cssparser-macros-0.6.0.bazel @@ -0,0 +1,55 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "reciprocal", # MPL-2.0 from expression "MPL-2.0" +]) + +# Generated Targets + +rust_library( + name = "cssparser_macros", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "proc-macro", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.6.0", + # buildifier: leave-alone + deps = [ + "@raze__quote__1_0_9//:quote", + "@raze__syn__1_0_73//:syn", + ], +) diff --git a/cargo/remote/BUILD.derive_more-0.99.16.bazel b/cargo/remote/BUILD.derive_more-0.99.16.bazel new file mode 100644 index 000000000..b3831e9bf --- /dev/null +++ b/cargo/remote/BUILD.derive_more-0.99.16.bazel @@ -0,0 +1,137 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +# Unsupported target "deny_missing_docs" with type "example" omitted + +rust_library( + name = "derive_more", + srcs = glob(["**/*.rs"]), + crate_features = [ + "add", + "add_assign", + "as_mut", + "as_ref", + "constructor", + "convert_case", + "default", + "deref", + "deref_mut", + "display", + "error", + "from", + "from_str", + "index", + "index_mut", + "into", + "into_iterator", + "is_variant", + "iterator", + "mul", + "mul_assign", + "not", + "rustc_version", + "sum", + "try_into", + "unwrap", + ], + crate_root = "src/lib.rs", + crate_type = "proc-macro", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.99.16", + # buildifier: leave-alone + deps = [ + "@raze__convert_case__0_4_0//:convert_case", + "@raze__proc_macro2__1_0_27//:proc_macro2", + "@raze__quote__1_0_9//:quote", + "@raze__syn__1_0_73//:syn", + ], +) + +# Unsupported target "add" with type "test" omitted + +# Unsupported target "add_assign" with type "test" omitted + +# Unsupported target "as_mut" with type "test" omitted + +# Unsupported target "as_ref" with type "test" omitted + +# Unsupported target "boats_display_derive" with type "test" omitted + +# Unsupported target "constructor" with type "test" omitted + +# Unsupported target "deref" with type "test" omitted + +# Unsupported target "deref_mut" with type "test" omitted + +# Unsupported target "display" with type "test" omitted + +# Unsupported target "error" with type "test" omitted + +# Unsupported target "from" with type "test" omitted + +# Unsupported target "from_str" with type "test" omitted + +# Unsupported target "generics" with type "test" omitted + +# Unsupported target "index" with type "test" omitted + +# Unsupported target "index_mut" with type "test" omitted + +# Unsupported target "into" with type "test" omitted + +# Unsupported target "into_iterator" with type "test" omitted + +# Unsupported target "is_variant" with type "test" omitted + +# Unsupported target "lib" with type "test" omitted + +# Unsupported target "mul" with type "test" omitted + +# Unsupported target "mul_assign" with type "test" omitted + +# Unsupported target "no_std" with type "test" omitted + +# Unsupported target "not" with type "test" omitted + +# Unsupported target "sum" with type "test" omitted + +# Unsupported target "try_into" with type "test" omitted + +# Unsupported target "unwrap" with type "test" omitted diff --git a/cargo/remote/BUILD.dtoa-0.4.8.bazel b/cargo/remote/BUILD.dtoa-0.4.8.bazel new file mode 100644 index 000000000..21cce7af9 --- /dev/null +++ b/cargo/remote/BUILD.dtoa-0.4.8.bazel @@ -0,0 +1,57 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "dtoa", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.8", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "test" with type "test" omitted diff --git a/cargo/remote/BUILD.dtoa-short-0.3.3.bazel b/cargo/remote/BUILD.dtoa-short-0.3.3.bazel new file mode 100644 index 000000000..9578fbd4c --- /dev/null +++ b/cargo/remote/BUILD.dtoa-short-0.3.3.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "reciprocal", # MPL-2.0 from expression "MPL-2.0" +]) + +# Generated Targets + +rust_library( + name = "dtoa_short", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.3.3", + # buildifier: leave-alone + deps = [ + "@raze__dtoa__0_4_8//:dtoa", + ], +) diff --git a/cargo/remote/BUILD.dunce-1.0.2.bazel b/cargo/remote/BUILD.dunce-1.0.2.bazel new file mode 100644 index 000000000..c86346a0a --- /dev/null +++ b/cargo/remote/BUILD.dunce-1.0.2.bazel @@ -0,0 +1,53 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "unencumbered", # CC0-1.0 from expression "CC0-1.0" +]) + +# Generated Targets + +rust_library( + name = "dunce", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.2", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/cargo/remote/BUILD.fxhash-0.2.1.bazel b/cargo/remote/BUILD.fxhash-0.2.1.bazel new file mode 100644 index 000000000..c0d7d1025 --- /dev/null +++ b/cargo/remote/BUILD.fxhash-0.2.1.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" +]) + +# Generated Targets + +# Unsupported target "fxhash" with type "bench" omitted + +rust_library( + name = "fxhash", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.1", + # buildifier: leave-alone + deps = [ + "@raze__byteorder__1_4_3//:byteorder", + ], +) diff --git a/cargo/remote/BUILD.kuchiki-0.8.1.bazel b/cargo/remote/BUILD.kuchiki-0.8.1.bazel new file mode 100644 index 000000000..a332d62e4 --- /dev/null +++ b/cargo/remote/BUILD.kuchiki-0.8.1.bazel @@ -0,0 +1,61 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +# Unsupported target "find_matches" with type "example" omitted + +# Unsupported target "stack-overflow" with type "example" omitted + +rust_library( + name = "kuchiki", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.8.1", + # buildifier: leave-alone + deps = [ + "@raze__cssparser__0_27_2//:cssparser", + "@raze__html5ever__0_25_1//:html5ever", + "@raze__matches__0_1_8//:matches", + "@raze__selectors__0_22_0//:selectors", + ], +) diff --git a/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel b/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel new file mode 100644 index 000000000..6792e2a9b --- /dev/null +++ b/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel @@ -0,0 +1,71 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "linkcheck", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "serde", + "serde-1", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.1-alpha.0", + # buildifier: leave-alone + deps = [ + "@raze__bytes__1_0_1//:bytes", + "@raze__codespan__0_11_1//:codespan", + "@raze__dunce__1_0_2//:dunce", + "@raze__futures__0_3_15//:futures", + "@raze__http__0_2_4//:http", + "@raze__kuchiki__0_8_1//:kuchiki", + "@raze__lazy_static__1_4_0//:lazy_static", + "@raze__linkify__0_5_0//:linkify", + "@raze__log__0_4_14//:log", + "@raze__pulldown_cmark__0_8_0//:pulldown_cmark", + "@raze__regex__1_5_4//:regex", + "@raze__reqwest__0_11_4//:reqwest", + "@raze__serde__1_0_126//:serde", + "@raze__thiserror__1_0_25//:thiserror", + "@raze__url__2_2_2//:url", + ], +) diff --git a/cargo/remote/BUILD.linkify-0.5.0.bazel b/cargo/remote/BUILD.linkify-0.5.0.bazel new file mode 100644 index 000000000..1de64f713 --- /dev/null +++ b/cargo/remote/BUILD.linkify-0.5.0.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "url" with type "bench" omitted + +rust_library( + name = "linkify", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.5.0", + # buildifier: leave-alone + deps = [ + "@raze__memchr__2_4_0//:memchr", + ], +) + +# Unsupported target "email" with type "test" omitted + +# Unsupported target "types" with type "test" omitted + +# Unsupported target "url" with type "test" omitted diff --git a/cargo/remote/BUILD.nodrop-0.1.14.bazel b/cargo/remote/BUILD.nodrop-0.1.14.bazel index 2e894b2f0..6e2e60ddc 100644 --- a/cargo/remote/BUILD.nodrop-0.1.14.bazel +++ b/cargo/remote/BUILD.nodrop-0.1.14.bazel @@ -34,6 +34,8 @@ rust_library( name = "nodrop", srcs = glob(["**/*.rs"]), crate_features = [ + "default", + "std", ], crate_root = "src/lib.rs", crate_type = "lib", diff --git a/cargo/remote/BUILD.pest-2.1.3.bazel b/cargo/remote/BUILD.pest-2.1.3.bazel new file mode 100644 index 000000000..e5e1d5b75 --- /dev/null +++ b/cargo/remote/BUILD.pest-2.1.3.bazel @@ -0,0 +1,60 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "parens" with type "example" omitted + +rust_library( + name = "pest", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "2.1.3", + # buildifier: leave-alone + deps = [ + "@raze__ucd_trie__0_1_3//:ucd_trie", + ], +) + +# Unsupported target "calculator" with type "test" omitted + +# Unsupported target "json" with type "test" omitted diff --git a/cargo/remote/BUILD.phf-0.8.0.bazel b/cargo/remote/BUILD.phf-0.8.0.bazel index 43a72b355..c4ff0c4ef 100644 --- a/cargo/remote/BUILD.phf-0.8.0.bazel +++ b/cargo/remote/BUILD.phf-0.8.0.bazel @@ -35,12 +35,19 @@ rust_library( srcs = glob(["**/*.rs"]), crate_features = [ "default", + "macros", + "phf_macros", + "proc-macro-hack", "std", ], crate_root = "src/lib.rs", crate_type = "lib", data = [], edition = "2018", + proc_macro_deps = [ + "@raze__phf_macros__0_8_0//:phf_macros", + "@raze__proc_macro_hack__0_5_19//:proc_macro_hack", + ], rustc_flags = [ "--cap-lints=allow", ], diff --git a/cargo/remote/BUILD.phf_macros-0.8.0.bazel b/cargo/remote/BUILD.phf_macros-0.8.0.bazel new file mode 100644 index 000000000..40683d7c0 --- /dev/null +++ b/cargo/remote/BUILD.phf_macros-0.8.0.bazel @@ -0,0 +1,67 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "phf_macros", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "proc-macro", + data = [], + edition = "2018", + proc_macro_deps = [ + "@raze__proc_macro_hack__0_5_19//:proc_macro_hack", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.8.0", + # buildifier: leave-alone + deps = [ + "@raze__phf_generator__0_8_0//:phf_generator", + "@raze__phf_shared__0_8_0//:phf_shared", + "@raze__proc_macro2__1_0_27//:proc_macro2", + "@raze__quote__1_0_9//:quote", + "@raze__syn__1_0_73//:syn", + ], +) + +# Unsupported target "compiletest" with type "test" omitted + +# Unsupported target "test" with type "test" omitted diff --git a/cargo/remote/BUILD.reqwest-0.11.4.bazel b/cargo/remote/BUILD.reqwest-0.11.4.bazel new file mode 100644 index 000000000..e08e14c35 --- /dev/null +++ b/cargo/remote/BUILD.reqwest-0.11.4.bazel @@ -0,0 +1,139 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "blocking" with type "example" omitted + +# Unsupported target "form" with type "example" omitted + +# Unsupported target "json_dynamic" with type "example" omitted + +# Unsupported target "json_typed" with type "example" omitted + +# Unsupported target "simple" with type "example" omitted + +# Unsupported target "tor_socks" with type "example" omitted + +rust_library( + name = "reqwest", + srcs = glob(["**/*.rs"]), + aliases = { + "@raze__native_tls__0_2_7//:native_tls": "native_tls_crate", + }, + crate_features = [ + "__tls", + "default", + "default-tls", + "hyper-tls", + "native-tls-crate", + "tokio-native-tls", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.11.4", + # buildifier: leave-alone + deps = [ + "@raze__bytes__1_0_1//:bytes", + "@raze__http__0_2_4//:http", + "@raze__serde__1_0_126//:serde", + "@raze__serde_urlencoded__0_7_0//:serde_urlencoded", + "@raze__url__2_2_2//:url", + ] + selects.with_or({ + # cfg(not(target_arch = "wasm32")) + ( + "@rules_rust//rust/platform:aarch64-apple-ios", + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", + "@rules_rust//rust/platform:x86_64-apple-darwin", + "@rules_rust//rust/platform:x86_64-apple-ios", + "@rules_rust//rust/platform:x86_64-pc-windows-msvc", + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", + ): [ + "@raze__base64__0_13_0//:base64", + "@raze__encoding_rs__0_8_28//:encoding_rs", + "@raze__futures_core__0_3_15//:futures_core", + "@raze__futures_util__0_3_15//:futures_util", + "@raze__http_body__0_4_2//:http_body", + "@raze__hyper__0_14_9//:hyper", + "@raze__hyper_tls__0_5_0//:hyper_tls", + "@raze__ipnet__2_3_1//:ipnet", + "@raze__lazy_static__1_4_0//:lazy_static", + "@raze__log__0_4_14//:log", + "@raze__mime__0_3_16//:mime", + "@raze__native_tls__0_2_7//:native_tls", + "@raze__percent_encoding__2_1_0//:percent_encoding", + "@raze__pin_project_lite__0_2_6//:pin_project_lite", + "@raze__tokio__1_7_1//:tokio", + "@raze__tokio_native_tls__0_3_0//:tokio_native_tls", + ], + "//conditions:default": [], + }) + selects.with_or({ + # cfg(windows) + ( + "@rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "@raze__winreg__0_7_0//:winreg", + ], + "//conditions:default": [], + }), +) + +# Unsupported target "badssl" with type "test" omitted + +# Unsupported target "blocking" with type "test" omitted + +# Unsupported target "brotli" with type "test" omitted + +# Unsupported target "client" with type "test" omitted + +# Unsupported target "cookie" with type "test" omitted + +# Unsupported target "deflate" with type "test" omitted + +# Unsupported target "gzip" with type "test" omitted + +# Unsupported target "multipart" with type "test" omitted + +# Unsupported target "proxy" with type "test" omitted + +# Unsupported target "redirect" with type "test" omitted + +# Unsupported target "timeouts" with type "test" omitted + +# Unsupported target "wasm_simple" with type "test" omitted diff --git a/cargo/remote/BUILD.rustc_version-0.3.3.bazel b/cargo/remote/BUILD.rustc_version-0.3.3.bazel new file mode 100644 index 000000000..3880f5df9 --- /dev/null +++ b/cargo/remote/BUILD.rustc_version-0.3.3.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "rustc_version", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.3.3", + # buildifier: leave-alone + deps = [ + "@raze__semver__0_11_0//:semver", + ], +) + +# Unsupported target "all" with type "test" omitted diff --git a/cargo/remote/BUILD.selectors-0.22.0.bazel b/cargo/remote/BUILD.selectors-0.22.0.bazel new file mode 100644 index 000000000..05fc8ea1f --- /dev/null +++ b/cargo/remote/BUILD.selectors-0.22.0.bazel @@ -0,0 +1,97 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "reciprocal", # MPL-2.0 from expression "MPL-2.0" +]) + +# Generated Targets +# buildifier: disable=out-of-order-load +# buildifier: disable=load-on-top +load( + "@rules_rust//cargo:cargo_build_script.bzl", + "cargo_build_script", +) + +cargo_build_script( + name = "selectors_build_script", + srcs = glob(["**/*.rs"]), + build_script_env = { + }, + crate_features = [ + ], + crate_root = "build.rs", + data = glob(["**"]), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.22.0", + visibility = ["//visibility:private"], + deps = [ + "@raze__phf_codegen__0_8_0//:phf_codegen", + ], +) + +rust_library( + name = "selectors", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + proc_macro_deps = [ + "@raze__derive_more__0_99_16//:derive_more", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.22.0", + # buildifier: leave-alone + deps = [ + ":selectors_build_script", + "@raze__bitflags__1_2_1//:bitflags", + "@raze__cssparser__0_27_2//:cssparser", + "@raze__fxhash__0_2_1//:fxhash", + "@raze__log__0_4_14//:log", + "@raze__matches__0_1_8//:matches", + "@raze__phf__0_8_0//:phf", + "@raze__precomputed_hash__0_1_1//:precomputed_hash", + "@raze__servo_arc__0_1_1//:servo_arc", + "@raze__smallvec__1_6_1//:smallvec", + "@raze__thin_slice__0_1_1//:thin_slice", + ], +) diff --git a/cargo/remote/BUILD.semver-0.11.0.bazel b/cargo/remote/BUILD.semver-0.11.0.bazel new file mode 100644 index 000000000..f86d363d5 --- /dev/null +++ b/cargo/remote/BUILD.semver-0.11.0.bazel @@ -0,0 +1,61 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "semver", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.11.0", + # buildifier: leave-alone + deps = [ + "@raze__semver_parser__0_10_2//:semver_parser", + ], +) + +# Unsupported target "deprecation" with type "test" omitted + +# Unsupported target "diesel" with type "test" omitted + +# Unsupported target "serde" with type "test" omitted diff --git a/cargo/remote/BUILD.semver-parser-0.10.2.bazel b/cargo/remote/BUILD.semver-parser-0.10.2.bazel new file mode 100644 index 000000000..f7d8aff8b --- /dev/null +++ b/cargo/remote/BUILD.semver-parser-0.10.2.bazel @@ -0,0 +1,81 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_binary( + # Prefix bin name to disambiguate from (probable) collision with lib name + # N.B.: The exact form of this is subject to change. + name = "cargo_bin_semver_parser", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/main.rs", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.10.2", + # buildifier: leave-alone + deps = [ + ":semver_parser", + "@raze__pest__2_1_3//:pest", + ], +) + +rust_library( + name = "semver_parser", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.10.2", + # buildifier: leave-alone + deps = [ + "@raze__pest__2_1_3//:pest", + ], +) + +# Unsupported target "genpest" with type "test" omitted diff --git a/cargo/remote/BUILD.serde-1.0.126.bazel b/cargo/remote/BUILD.serde-1.0.126.bazel index 2538924ce..404ac3dee 100644 --- a/cargo/remote/BUILD.serde-1.0.126.bazel +++ b/cargo/remote/BUILD.serde-1.0.126.bazel @@ -44,6 +44,7 @@ cargo_build_script( crate_features = [ "default", "derive", + "rc", "serde_derive", "std", ], @@ -69,6 +70,7 @@ rust_library( crate_features = [ "default", "derive", + "rc", "serde_derive", "std", ], diff --git a/cargo/remote/BUILD.servo_arc-0.1.1.bazel b/cargo/remote/BUILD.servo_arc-0.1.1.bazel new file mode 100644 index 000000000..077f37d35 --- /dev/null +++ b/cargo/remote/BUILD.servo_arc-0.1.1.bazel @@ -0,0 +1,55 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "servo_arc", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.1", + # buildifier: leave-alone + deps = [ + "@raze__nodrop__0_1_14//:nodrop", + "@raze__stable_deref_trait__1_2_0//:stable_deref_trait", + ], +) diff --git a/cargo/remote/BUILD.thin-slice-0.1.1.bazel b/cargo/remote/BUILD.thin-slice-0.1.1.bazel new file mode 100644 index 000000000..e7fb05416 --- /dev/null +++ b/cargo/remote/BUILD.thin-slice-0.1.1.bazel @@ -0,0 +1,53 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "reciprocal", # MPL-2.0 from expression "MPL-2.0" +]) + +# Generated Targets + +rust_library( + name = "thin_slice", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.1", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/cargo/remote/BUILD.tokio-1.7.1.bazel b/cargo/remote/BUILD.tokio-1.7.1.bazel index 5d232262c..4c8cc1abb 100644 --- a/cargo/remote/BUILD.tokio-1.7.1.bazel +++ b/cargo/remote/BUILD.tokio-1.7.1.bazel @@ -47,6 +47,7 @@ cargo_build_script( "fs", "io-util", "libc", + "macros", "memchr", "mio", "net", @@ -55,6 +56,7 @@ cargo_build_script( "rt-multi-thread", "sync", "time", + "tokio-macros", "winapi", ], crate_root = "build.rs", @@ -103,6 +105,7 @@ rust_library( "fs", "io-util", "libc", + "macros", "memchr", "mio", "net", @@ -111,12 +114,16 @@ rust_library( "rt-multi-thread", "sync", "time", + "tokio-macros", "winapi", ], crate_root = "src/lib.rs", crate_type = "lib", data = [], edition = "2018", + proc_macro_deps = [ + "@raze__tokio_macros__1_3_0//:tokio_macros", + ], rustc_flags = [ "--cap-lints=allow", ], diff --git a/cargo/remote/BUILD.tokio-macros-1.3.0.bazel b/cargo/remote/BUILD.tokio-macros-1.3.0.bazel new file mode 100644 index 000000000..5b4641eae --- /dev/null +++ b/cargo/remote/BUILD.tokio-macros-1.3.0.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +rust_library( + name = "tokio_macros", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "proc-macro", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.3.0", + # buildifier: leave-alone + deps = [ + "@raze__proc_macro2__1_0_27//:proc_macro2", + "@raze__quote__1_0_9//:quote", + "@raze__syn__1_0_73//:syn", + ], +) diff --git a/cargo/remote/BUILD.ucd-trie-0.1.3.bazel b/cargo/remote/BUILD.ucd-trie-0.1.3.bazel new file mode 100644 index 000000000..99c1710aa --- /dev/null +++ b/cargo/remote/BUILD.ucd-trie-0.1.3.bazel @@ -0,0 +1,57 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "ucd_trie", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.3", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/cargo/remote/BUILD.url-2.2.2.bazel b/cargo/remote/BUILD.url-2.2.2.bazel index 8685952be..99424ea94 100644 --- a/cargo/remote/BUILD.url-2.2.2.bazel +++ b/cargo/remote/BUILD.url-2.2.2.bazel @@ -36,6 +36,7 @@ rust_library( name = "url", srcs = glob(["**/*.rs"]), crate_features = [ + "serde", ], crate_root = "src/lib.rs", crate_type = "lib", @@ -55,6 +56,7 @@ rust_library( "@raze__idna__0_2_3//:idna", "@raze__matches__0_1_8//:matches", "@raze__percent_encoding__2_1_0//:percent_encoding", + "@raze__serde__1_0_126//:serde", ], ) diff --git a/cargo/update.py b/cargo/update.py index a16731ec0..68135d447 100755 --- a/cargo/update.py +++ b/cargo/update.py @@ -21,6 +21,7 @@ COMMITS_SHALLOW_SINCE = { "1ee0892217e9a76bba4bb369ec5fab8854935a3c": "1619517354 +1000", # pct-str "4adccd8d4a222ab2672350a102f06ae832a0572d": "1605376517 +0100", + "2f20798ce521cc594d510d4e417e76d5eac04d4b": "1626729019 +0200", } import glob @@ -100,7 +101,7 @@ maybe( """.splitlines())) def generated_reqwest_build_file(): - return glob.glob("remote/*reqwest-*")[0] + return glob.glob("remote/*reqwest-0.11.3*")[0] def update_reqwest_deps(): diff --git a/rslib/BUILD.bazel b/rslib/BUILD.bazel index aca98dff7..1729dfe73 100644 --- a/rslib/BUILD.bazel +++ b/rslib/BUILD.bazel @@ -142,7 +142,8 @@ rust_test( rustc_env = _anki_rustc_env, deps = [ "//rslib/cargo:env_logger", - "//rslib/i18n:anki_i18n", + "//rslib/cargo:linkcheck", + "//rslib/cargo:utime", ], ) diff --git a/rslib/cargo/BUILD.bazel b/rslib/cargo/BUILD.bazel index b53ccca99..269db2de3 100644 --- a/rslib/cargo/BUILD.bazel +++ b/rslib/cargo/BUILD.bazel @@ -174,6 +174,15 @@ alias( ], ) +alias( + name = "linkcheck", + actual = "@raze__linkcheck__0_4_1_alpha_0//:linkcheck", + tags = [ + "cargo-raze", + "manual", + ], +) + alias( name = "nom", actual = "@raze__nom__7_0_0_alpha1//:nom", From 1ecda8cf4daf6edfbecbbcc40209f38d286ab786 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 19:40:00 +1000 Subject: [PATCH 09/14] fix clippy lints --- rslib/src/links.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 19d146bcb..333dee42f 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -3,7 +3,7 @@ use crate::backend_proto::links::help_page_link_request::HelpPage; -static HELP_SITE: &'static str = "https://docs.ankiweb.net/"; +static HELP_SITE: &str = "https://docs.ankiweb.net/"; impl HelpPage { pub fn to_link(self) -> String { @@ -64,8 +64,8 @@ mod test { .buffer_unordered(ctx.concurrency()) .collect::() .await; - if result.0.len() > 0 { - panic!(result.message()); + if !result.0.is_empty() { + panic!("invalid links found: {}", result.message()); } } From 0578729468d235c8aef08fb600f3bbbc316ef03e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 19:58:52 +1000 Subject: [PATCH 10/14] be explicit about .html suffix --- rslib/src/links.rs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 333dee42f..41a9c60ae 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -12,30 +12,30 @@ impl HelpPage { fn to_link_suffix(self) -> &'static str { match self { - HelpPage::NoteType => "getting-started#note-types", - HelpPage::Browsing => "browsing", - HelpPage::BrowsingFindAndReplace => "browsing#find-and-replace", - HelpPage::BrowsingNotesMenu => "browsing#notes", - HelpPage::KeyboardShortcuts => "studying#keyboard-shortcuts", - HelpPage::Editing => "editing", - HelpPage::AddingCardAndNote => "editing#adding-cards-and-notes", - HelpPage::AddingANoteType => "editing#adding-a-note-type", - HelpPage::Latex => "math#latex", - HelpPage::Preferences => "preferences", + HelpPage::NoteType => "getting-started.html#note-types", + HelpPage::Browsing => "browsing.html", + HelpPage::BrowsingFindAndReplace => "browsing.html#find-and-replace", + HelpPage::BrowsingNotesMenu => "browsing.html#notes", + HelpPage::KeyboardShortcuts => "studying.html#keyboard-shortcuts", + HelpPage::Editing => "editing.html", + HelpPage::AddingCardAndNote => "editing.html#adding-cards-and-notes", + HelpPage::AddingANoteType => "editing.html#adding-a-note-type", + HelpPage::Latex => "math.html#latex", + HelpPage::Preferences => "preferences.html", HelpPage::Index => "", - HelpPage::Templates => "templates/intro", - HelpPage::FilteredDeck => "filtered-decks", - HelpPage::Importing => "importing", - HelpPage::CustomizingFields => "editing#customizing-fields", - HelpPage::DeckOptions => "deck-options", - HelpPage::EditingFeatures => "editing#features", + HelpPage::Templates => "templates/intro.html", + HelpPage::FilteredDeck => "filtered-decks.html", + HelpPage::Importing => "importing.html", + HelpPage::CustomizingFields => "editing.html#customizing-fields", + HelpPage::DeckOptions => "deck-options.html", + HelpPage::EditingFeatures => "editing.html#features", } } } #[cfg(test)] mod test { - use super::*; + use std::iter; use futures::StreamExt; use itertools::Itertools; @@ -44,9 +44,10 @@ mod test { BasicContext, }; use reqwest::Url; - use std::iter; use strum::IntoEnumIterator; + use super::*; + /// Aggregates [`Outcome`]s by collecting the error messages of the invalid ones. #[derive(Default)] struct Outcomes(Vec); From e1f9d0fc1b4430221b98055db3c73b7216ba296f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 20:17:20 +1000 Subject: [PATCH 11/14] fix Python lints --- pylib/.pylintrc | 1 + pylib/anki/collection.py | 2 +- qt/aqt/utils.py | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pylib/.pylintrc b/pylib/.pylintrc index 0bb5dd5b5..76d60e6fb 100644 --- a/pylib/.pylintrc +++ b/pylib/.pylintrc @@ -16,6 +16,7 @@ ignored-classes= BackendError, SetDeckCollapsedRequest, ConfigKey, + HelpPageLinkRequest [REPORTS] output-format=colorized diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 7b4555417..47c73fc44 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -19,7 +19,7 @@ from anki import ( from anki._legacy import DeprecatedNamesMixin, deprecated # protobuf we publicly export - listed first to avoid circular imports -HelpPage = links_pb2.HelpPageLinkRequest +HelpPage = links_pb2.HelpPageLinkRequest.HelpPage SearchNode = search_pb2.SearchNode Progress = collection_pb2.Progress EmptyCardsReport = card_rendering_pb2.EmptyCardsReport diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 2a307d922..263ab4523 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -6,7 +6,6 @@ import os import re import subprocess import sys -from enum import Enum from functools import wraps from typing import ( TYPE_CHECKING, @@ -69,7 +68,7 @@ def locale_dir() -> str: # shortcut to access Fluent translations; set as tr = tr_legacyglobal -HelpPageArgument = Union["HelpPage.HelpPage.V", str] +HelpPageArgument = Union["HelpPage.V", str] def openHelp(section: HelpPageArgument) -> None: From b1dedb1b1f7d7a221d782b6fa7a289942182f30d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 20:18:20 +1000 Subject: [PATCH 12/14] disable link check outside CI --- .bazelrc | 2 +- rslib/src/links.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 3e0333f07..b90c3c2c8 100644 --- a/.bazelrc +++ b/.bazelrc @@ -26,7 +26,7 @@ test --test_output=errors # don't add empty __init__.py files build --incompatible_default_to_explicit_init_py -build:ci --show_timestamps --isatty=0 --color=yes --show_progress_rate_limit=5 +build:ci --show_timestamps --isatty=0 --color=yes --show_progress_rate_limit=5 --action_env=ANKI_CI=1 build:opt -c opt # the TypeScript workers on Windows choke when deps are changed while they're diff --git a/rslib/src/links.rs b/rslib/src/links.rs index 41a9c60ae..de23dfecb 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -35,7 +35,7 @@ impl HelpPage { #[cfg(test)] mod test { - use std::iter; + use std::{env, iter}; use futures::StreamExt; use itertools::Itertools; @@ -59,6 +59,11 @@ mod test { #[tokio::test] async fn check_links() { + if env::var("ANKI_CI").is_err() { + println!("Skip, ANKI_CI not set."); + return; + } + let ctx = BasicContext::default(); let result = futures::stream::iter(HelpPage::iter()) .map(|page| check_page(page, &ctx)) From 6b5ee469bb63793e0598b8924dc446e06d366cb1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jul 2021 21:00:51 +1000 Subject: [PATCH 13/14] attempt to fix Linux build --- cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel | 2 +- cargo/update.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel b/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel index 6792e2a9b..73da5ab0c 100644 --- a/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel +++ b/cargo/remote/BUILD.linkcheck-0.4.1-alpha.0.bazel @@ -63,7 +63,7 @@ rust_library( "@raze__log__0_4_14//:log", "@raze__pulldown_cmark__0_8_0//:pulldown_cmark", "@raze__regex__1_5_4//:regex", - "@raze__reqwest__0_11_4//:reqwest", + "@reqwest_rustls//:reqwest", "@raze__serde__1_0_126//:serde", "@raze__thiserror__1_0_25//:thiserror", "@raze__url__2_2_2//:url", diff --git a/cargo/update.py b/cargo/update.py index 68135d447..f626e3272 100755 --- a/cargo/update.py +++ b/cargo/update.py @@ -127,6 +127,15 @@ def update_reqwest_deps(): file.seek(0) file.write(data) + with open("remote/BUILD.linkcheck-0.4.1-alpha.0.bazel") as f: + out = [] + for line in f.readlines(): + line = line.replace("@raze__reqwest__0_11_4//:reqwest","@reqwest_rustls//:reqwest") + out.append(line) + with open("remote/BUILD.linkcheck-0.4.1-alpha.0.bazel", "w") as f: + f.writelines(out) + + def stage_commit(): subprocess.run( From 07752f43cd8e0fab8494f86776ca1a3deaadf71d Mon Sep 17 00:00:00 2001 From: RumovZ Date: Fri, 23 Jul 2021 19:40:51 +0200 Subject: [PATCH 14/14] Fix linkcheck result message --- rslib/src/links.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rslib/src/links.rs b/rslib/src/links.rs index de23dfecb..366bec92b 100644 --- a/rslib/src/links.rs +++ b/rslib/src/links.rs @@ -71,7 +71,7 @@ mod test { .collect::() .await; if !result.0.is_empty() { - panic!("invalid links found: {}", result.message()); + panic!("{}", result.message()); } } @@ -115,8 +115,8 @@ mod test { impl Outcomes { fn message(&self) -> String { - iter::once(&format!("{} link(s) could not be validated:", self.0.len())) - .chain(self.0.iter()) + iter::once("invalid links found:") + .chain(self.0.iter().map(String::as_str)) .join("\n - ") } }