Skip to content

Commit

Permalink
Update deps; pretty diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Jan 31, 2025
1 parent dd2080c commit 5f21b89
Show file tree
Hide file tree
Showing 40 changed files with 621 additions and 432 deletions.
851 changes: 475 additions & 376 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ rust-version = "1.80"
eipw-snippets = { path = "eipw-snippets", version = "0.2.0-dev" }
eipw-lint = { path = "eipw-lint", version = "0.10.0-dev" }
eipw-preamble = { path = "eipw-preamble", version = "0.3.0-dev" }
tokio = "1.40.0"
serde_json = "1.0.108"
tokio = "1.43.0"
serde_json = "1.0.138"
toml = "0.8.19"
serde = "1.0.164"
serde = "1.0.217"
getrandom = "0.2.15"
regex = "1.11.0"
regex = "1.11.1"
snafu = "0.8.5"
assert_matches = "1.5.0"
pretty_assertions = "1.4.1"

[package]
name = "eipw"
Expand All @@ -40,9 +41,9 @@ serde_json.workspace = true
toml.workspace = true
serde = { workspace = true, features = [ "derive" ] }

sysexits = "0.8.2"
clap = { version = "4.5.18", features = [ "derive", "cargo" ] }
thiserror = "1.0.64"
sysexits = "0.8.5"
clap = { version = "4.5.27", features = [ "derive", "cargo" ] }
thiserror = "2.0.11"

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { workspace = true, features = [ "macros", "rt" ] }
Expand Down
9 changes: 5 additions & 4 deletions eipw-lint-js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ serde_json.workspace = true
serde = { workspace = true, features = [ "derive" ] }
getrandom = { workspace = true, features = [ "js" ] }

wasm-bindgen = { version = "0.2.93", features = [ "serde-serialize" ] }
wasm-bindgen = { version = "0.2.100", features = [ "serde-serialize" ] }
serde-wasm-bindgen = "0.6.5"
wasm-bindgen-futures = "0.4.43"
wasm-bindgen-futures = "0.4.50"
console_error_panic_hook = { version = "0.1.7", optional = true }
js-sys = "0.3.70"
js-sys = "0.3.77"

[dev-dependencies]
wasm-bindgen-test = "0.3.43"
pretty_assertions.workspace = true
wasm-bindgen-test = "0.3.50"
18 changes: 17 additions & 1 deletion eipw-lint-js/tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use eipw_lint_js::{format, lint};

use js_sys::Object;

use pretty_assertions::assert_eq;

use serde::Serialize;

use serde_json::json;
Expand Down Expand Up @@ -114,7 +116,21 @@ async fn lint_json_schema() {
"title": "see https://ethereum.github.io/eipw/markdown-json-cite/"
}
],
"formatted": "error[markdown-json-cite]: code block of type `csl-json` does not conform to required schema\n --> tests/eips/eip-2000.md:42:1\n |\n42 | // ```csl-json\n43 | || {\n44 | || \"type\": \"article\",\n45 | || \"id\": \"1\",\n46 | || \"URL\": \"3\"\n | ||__________________^ \"3\" is not a \"uri\"\n | ||__________________^ \"DOI\" is a required property\n |\n = help: see https://github.com/ethereum/eipw/blob/master/eipw-lint/src/lints/markdown/json_schema/citation.json\n = help: see https://ethereum.github.io/eipw/markdown-json-cite/",
"formatted": r#"error[markdown-json-cite]: code block of type `csl-json` does not conform to required schema
--> tests/eips/eip-2000.md:42:1
|
42 | / ```csl-json
43 | | {
44 | | "type": "article",
45 | | "id": "1",
46 | | "URL": "3"
| | ^
| |__________________|
| "3" is not a "uri"
| "DOI" is a required property
|
= help: see https://github.com/ethereum/eipw/blob/master/eipw-lint/src/lints/markdown/json_schema/citation.json
= help: see https://ethereum.github.io/eipw/markdown-json-cite/"#,
"id": "markdown-json-cite",
"level": "Error",
"snippets": [
Expand Down
13 changes: 7 additions & 6 deletions eipw-lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ regex.workspace = true
serde = { workspace = true, features = [ "derive" ] }
tokio = { optional = true, workspace = true, features = [ "macros" ] }

comrak = { version = "0.29.0", default-features = false }
url = "2.5.2"
chrono = { version = "0.4.38", default-features = false }
comrak = { version = "0.35.0", default-features = false }
url = "2.5.4"
chrono = { version = "0.4.39", default-features = false }
educe = { version = "0.6.0", default-features = false, features = [ "Debug" ] }
scraper = { version = "0.20.0", default-features = false }
jsonschema = { version = "0.21.0", default-features = false }
formatx = "0.2.2"
scraper = { version = "0.22.0", default-features = false }
jsonschema = { version = "0.28.3", default-features = false }
formatx = "0.2.3"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true, features = [ "fs", "macros" ] }
Expand All @@ -34,5 +34,6 @@ tokio = { workspace = true, features = [ "fs", "macros", "rt" ] }

[dev-dependencies]
assert_matches.workspace = true
pretty_assertions.workspace = true
tokio = { workspace = true, features = [ "macros", "rt" ] }
toml.workspace = true
12 changes: 6 additions & 6 deletions eipw-lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,12 +982,12 @@ fn process<'a>(
};

let options = comrak::Options {
extension: comrak::ExtensionOptionsBuilder::default()
.table(true)
.autolink(true)
.footnotes(true)
.build()
.unwrap(),
extension: comrak::ExtensionOptions {
table: true,
autolink: true,
footnotes: true,
..Default::default()
},
..Default::default()
};

Expand Down
32 changes: 31 additions & 1 deletion eipw-lint/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use comrak::arena_tree::{NodeEdge, Traverse};
use comrak::nodes::{
Ast, AstNode, NodeCode, NodeCodeBlock, NodeDescriptionItem, NodeFootnoteDefinition,
Ast, AstNode, NodeAlert, NodeCode, NodeCodeBlock, NodeDescriptionItem, NodeFootnoteDefinition,
NodeFootnoteReference, NodeHeading, NodeHtmlBlock, NodeLink, NodeList, NodeMath,
NodeMultilineBlockQuote, NodeTable, NodeValue, NodeWikiLink,
};
Expand Down Expand Up @@ -53,6 +53,7 @@ pub trait Visitor {
NodeValue::Strong => self.enter_strong(&data),
NodeValue::Strikethrough => self.enter_strikethrough(&data),
NodeValue::Superscript => self.enter_superscript(&data),
NodeValue::Subscript => self.enter_subscript(&data),
NodeValue::Link(nl) => self.enter_link(&data, nl),
NodeValue::Image(nl) => self.enter_image(&data, nl),
NodeValue::FootnoteReference(fr) => self.enter_footnote_reference(&data, fr),
Expand All @@ -63,9 +64,15 @@ pub trait Visitor {
NodeValue::MultilineBlockQuote(m) => self.enter_multiline_block_quote(&data, m),
NodeValue::SpoileredText => self.enter_spoilered_text(&data),
NodeValue::Escaped => self.enter_escaped(&data),
NodeValue::Raw(r) => self.enter_raw(&data, r),
NodeValue::Alert(a) => self.enter_alert(&data, a),
}
}

fn enter_alert(&mut self, _ast: &Ast, _alert: &NodeAlert) -> Result<Next, Self::Error> {
Ok(Next::TraverseChildren)
}

fn enter_document(&mut self, _ast: &Ast) -> Result<Next, Self::Error> {
Ok(Next::TraverseChildren)
}
Expand Down Expand Up @@ -194,6 +201,10 @@ pub trait Visitor {
Ok(Next::TraverseChildren)
}

fn enter_subscript(&mut self, _ast: &Ast) -> Result<Next, Self::Error> {
Ok(Next::TraverseChildren)
}

fn enter_link(&mut self, _ast: &Ast, _link: &NodeLink) -> Result<Next, Self::Error> {
Ok(Next::TraverseChildren)
}
Expand Down Expand Up @@ -242,9 +253,14 @@ pub trait Visitor {
Ok(Next::TraverseChildren)
}

fn enter_raw(&mut self, _ast: &Ast, _raw: &str) -> Result<Next, Self::Error> {
Ok(Next::TraverseChildren)
}

fn depart(&mut self, node: &AstNode) -> Result<(), Self::Error> {
let data = node.data.borrow();
match &data.value {
NodeValue::Alert(a) => self.depart_alert(&data, a),
NodeValue::Document => self.depart_document(&data),
NodeValue::FrontMatter(fm) => self.depart_front_matter(&data, fm),
NodeValue::BlockQuote => self.depart_block_quote(&data),
Expand Down Expand Up @@ -273,6 +289,7 @@ pub trait Visitor {
NodeValue::Strong => self.depart_strong(&data),
NodeValue::Strikethrough => self.depart_strikethrough(&data),
NodeValue::Superscript => self.depart_superscript(&data),
NodeValue::Subscript => self.depart_subscript(&data),
NodeValue::Link(nl) => self.depart_link(&data, nl),
NodeValue::Image(nl) => self.depart_image(&data, nl),
NodeValue::FootnoteReference(fr) => self.depart_footnote_reference(&data, fr),
Expand All @@ -283,9 +300,14 @@ pub trait Visitor {
NodeValue::MultilineBlockQuote(m) => self.depart_multiline_block_quote(&data, m),
NodeValue::SpoileredText => self.depart_spoilered_text(&data),
NodeValue::Escaped => self.depart_escaped(&data),
NodeValue::Raw(r) => self.depart_raw(&data, r),
}
}

fn depart_alert(&mut self, _ast: &Ast, _alert: &NodeAlert) -> Result<(), Self::Error> {
Ok(())
}

fn depart_document(&mut self, _ast: &Ast) -> Result<(), Self::Error> {
Ok(())
}
Expand Down Expand Up @@ -414,6 +436,10 @@ pub trait Visitor {
Ok(())
}

fn depart_subscript(&mut self, _ast: &Ast) -> Result<(), Self::Error> {
Ok(())
}

fn depart_link(&mut self, _ast: &Ast, _link: &NodeLink) -> Result<(), Self::Error> {
Ok(())
}
Expand Down Expand Up @@ -461,6 +487,10 @@ pub trait Visitor {
fn depart_escaped(&mut self, _ast: &Ast) -> Result<(), Self::Error> {
Ok(())
}

fn depart_raw(&mut self, _ast: &Ast, _raw: &str) -> Result<(), Self::Error> {
Ok(())
}
}

pub trait TraverseExt {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/eipv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use eipw_lint::reporters::Text;
use eipw_lint::Linter;

use pretty_assertions::assert_eq;
use std::io::ErrorKind;
use std::path::{Path, PathBuf};

Expand Down
16 changes: 9 additions & 7 deletions eipw-lint/tests/eipv/markdown-json-cite/expected.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
error[markdown-json-cite]: code block of type `csl-json` does not conform to required schema
--> input.md:42:1
|
42 | // ```csl-json
43 | || {
44 | || "type": "article",
45 | || "id": "1",
46 | || "URL": "3"
| ||__________________^ "3" is not a "uri"
| ||__________________^ "DOI" is a required property
42 | / ```csl-json
43 | | {
44 | | "type": "article",
45 | | "id": "1",
46 | | "URL": "3"
| | ^
| |__________________|
| "3" is not a "uri"
| "DOI" is a required property
|
= help: see https://github.com/ethereum/eipw/blob/master/eipw-lint/src/lints/markdown/json_schema/citation.json
5 changes: 3 additions & 2 deletions eipw-lint/tests/eipv/preamble-missing-required/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ error[preamble-requires-ref-title]: proposals mentioned in preamble header `titl
--> input.md:3:31
|
3 | title: A sample extension for EIP-1 and EIP-5
| ^^^^^ mentioned here
| ^^^^^ mentioned here
| ^^^^^ ^^^^^ mentioned here
| |
| mentioned here
|
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ error[preamble-list-requires]: preamble header list items must begin with a spac
--> input.md:11:13
|
11 | requires: 20,1337,2048
| ^ missing space
| ^ missing space
| ^ ^ missing space
| |
| missing space
|
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ error[preamble-requires-status]: preamble header `requires` contains items not s
--> input.md:12:10
|
12 | requires: 20, 1337, 2048
| ^^^ has a less advanced status
| ^^^^^ has a less advanced status
| ^^^ ^^^^^ has a less advanced status
| |
| has a less advanced status
|
= help: valid `status` values for this proposal are: `Draft`, `Stagnant`
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_heading_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

use eipw_lint::{lints::markdown::HeadingFirst, reporters::Text, Linter};
use pretty_assertions::assert_eq;

#[tokio::test]
async fn invalid_eip() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_headings_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::HeadingsSpace;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn normal_headings() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_html_comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::HtmlComments;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn warn() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_json_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::JsonSchema;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn invalid_json() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_link_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::LinkFirst;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn unlinked_then_linked_with_header() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_no_backticks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::NoBackticks;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn eip_in_backticks() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::regex::{Mode, Regex};
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn excludes_link_match_in_text() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_relative_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::RelativeLinks;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn inline_link_to_consensus_specs() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_section_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::SectionOrder;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn one_extra() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_markdown_section_required.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::markdown::SectionRequired;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn one_missing() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_preamble_author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::preamble::Author;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn unicode_invalid() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_preamble_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::preamble::Date;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn single_digit_month() {
Expand Down
1 change: 1 addition & 0 deletions eipw-lint/tests/lint_preamble_file_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use eipw_lint::lints::preamble::FileName;
use eipw_lint::reporters::Text;
use eipw_lint::Linter;
use pretty_assertions::assert_eq;

#[tokio::test]
async fn unicode() {
Expand Down
Loading

0 comments on commit 5f21b89

Please sign in to comment.