Update doku dependency for easier formatting of defaults.hjson (#2553)

This commit is contained in:
Nutomic 2022-11-11 21:01:29 +00:00 committed by GitHub
parent 42674b7abd
commit 83d2959b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

8
Cargo.lock generated
View File

@ -1219,9 +1219,9 @@ dependencies = [
[[package]]
name = "doku"
version = "0.12.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6e0b8876b34b3a2504166bac1a5a8cb7ad65dc854e7a70b1114c055df1efc04"
checksum = "966b1227ac4d9d77f4d7e9507dd01c56ceaec6e35888661b54319123da47b159"
dependencies = [
"doku-derive",
"serde",
@ -1231,9 +1231,9 @@ dependencies = [
[[package]]
name = "doku-derive"
version = "0.12.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6430bef5fcbfa22f3c431f05a14254d45f41ab634cabe09fad82e98d4f9fdc8b"
checksum = "252ec56116f931b050b5d80512c2c76f4807a297dd95a93f37593dd7650868a5"
dependencies = [
"darling 0.13.4",
"proc-macro2 1.0.47",

View File

@ -66,7 +66,7 @@ reqwest = { version = "0.11.12", features = ["json"] }
reqwest-middleware = "0.1.6"
reqwest-tracing = "0.3.1"
clokwerk = "0.3.5"
doku = { version = "0.12.0", features = ["url-2"] }
doku = { version = "0.20.0", features = ["url-2"] }
parking_lot = "0.12.1"
reqwest-retry = "0.1.5"
console-subscriber = { version = "0.1.8", optional = true }

View File

@ -30,7 +30,7 @@
smtp_login: "string"
# Password to login to the smtp server
smtp_password: "string"
# Address to send emails from, eg noreply@your-instance.com
# Address to send emails from, eg "noreply@your-instance.com"
smtp_from_address: "noreply@example.com"
# Whether or not smtp connections should use tls. Can be none, tls, or starttls
tls_type: "none"

View File

@ -38,7 +38,7 @@ http = "0.2.8"
deser-hjson = "1.0.2"
smart-default = "0.6.0"
jsonwebtoken = "8.1.1"
doku = { version = "0.12.0", features = ["url-2"] }
doku = { version = "0.20.0", features = ["url-2"] }
uuid = { version = "1.2.1", features = ["serde", "v4"] }
html2text = "0.4.3"
rosetta-i18n = "0.1.2"

View File

@ -4,10 +4,3 @@ set -e
dest=${1-config/defaults.hjson}
cargo run -- --print-config-docs > "$dest"
# replace // comments with #
sed -i "s/^\([[:space:]]*\)\/\//\1#/" "$dest"
# remove trailing commas
sed -i "s/,\$//" "$dest"
# remove quotes around json keys
sed -i "s/\"//" "$dest"
sed -i "s/\"//" "$dest"

View File

@ -4,7 +4,7 @@ extern crate diesel_migrations;
use actix::prelude::*;
use actix_web::{web::Data, *};
use diesel_migrations::EmbeddedMigrations;
use doku::json::{AutoComments, Formatting};
use doku::json::{AutoComments, CommentsStyle, Formatting, ObjectsStyle};
use lemmy_api::match_websocket_operation;
use lemmy_api_common::{
lemmy_db_views::structs::SiteView,
@ -56,6 +56,13 @@ async fn main() -> Result<(), LemmyError> {
if args.len() == 2 && args[1] == "--print-config-docs" {
let fmt = Formatting {
auto_comments: AutoComments::none(),
comments_style: CommentsStyle {
separator: "#".to_owned(),
},
objects_style: ObjectsStyle {
surround_keys_with_quotes: false,
use_comma_as_separator: false,
},
..Default::default()
};
println!("{}", doku::to_json_fmt_val(&fmt, &Settings::default()));