Skip to content

Commit

Permalink
Lint csl-json blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Dec 6, 2022
1 parent f0e4bab commit 453daf4
Show file tree
Hide file tree
Showing 13 changed files with 1,296 additions and 3 deletions.
208 changes: 207 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ error[preamble-order]: preamble header `description` must come after `title`

| id | Description |
|-------------------------------------|-----------------------------------------------------------------------------------------------|
| `markdown-json-cite` | All `csl-json` code blocks adhere to the correct schema. |
| `markdown-link-first` | First mention of an EIP must be a link. |
| `markdown-link-status` | EIPs linked in the body have statuses further along than the current proposal. |
| `markdown-order-section` | There are no extra sections and the sections are in the correct order. |
Expand Down
3 changes: 2 additions & 1 deletion eipw-lint-js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eipw-lint-js"
version = "0.2.5"
version = "0.2.6"
edition = "2021"
license = "MPL-2.0"
rust-version = "1.60"
Expand All @@ -27,6 +27,7 @@ eipw-lint = { version = "0.2.0", path = "../eipw-lint" }
js-sys = "0.3.60"
serde_json = "1.0.86"
serde = { version = "1.0", features = [ "derive" ] }
getrandom = { version = "0.2.8", features = [ "js" ] }

[dev-dependencies]
wasm-bindgen-test = "0.3.33"
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ chrono = { version = "0.4.22", default-features = false }
educe = { version = "0.4.19", default-features = false, features = [ "Debug" ] }
tokio = { optional = true, version = "1.21.2", features = [ "macros" ] }
scraper = { version = "0.13.0", default-features = false }
jsonschema = { version = "0.16.1", default-features = false }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.21.2", features = [ "fs", "macros" ] }
Expand Down
21 changes: 20 additions & 1 deletion eipw-lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,25 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
&["Final", "Withdrawn", "Living"],
]
}.boxed(),
)
),
(
"markdown-json-cite",
markdown::JsonSchema {
additional_schemas: &[
(
"https://resource.citationstyles.org/schema/v1.0/input/json/csl-data.json",
include_str!("lints/markdown/json_schema/csl-data.json"),
),
],
schema: include_str!("lints/markdown/json_schema/citation.json"),
language: "csl-json",
help: concat!(
"see https://github.com/ethereum/eipw/blob/",
"master/eipw-lint/src/lints/markdown/",
"json_schema/citation.json",
),
}.boxed(),
),
]
.into_iter()
}
Expand Down Expand Up @@ -740,6 +758,7 @@ fn process<'r, 'a>(
extension: ComrakExtensionOptions {
table: true,
autolink: true,
footnotes: true,
..Default::default()
},
..Default::default()
Expand Down
Loading

0 comments on commit 453daf4

Please sign in to comment.