Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

Merge branch 'master' into local-stats

Elijah Pottere5a5f7e5bbc8
diff --cc Cargo.lock
index 0b7d398be,fec0f27d8..9559845f7
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -849,22 -811,9 +850,22 @@@ dependencies =
"tracing-subscriber",
]
+[[package]]
+name = "harper-stats"
- version = "0.26.0"
++version = "0.27.0"
+dependencies = [
+ "chrono",
+ "harper-core",
+ "quickcheck",
+ "quickcheck_macros",
+ "serde",
+ "serde_json",
+ "uuid",
+]
+
[[package]]
name = "harper-tree-sitter"
- version = "0.26.0"
+ version = "0.27.0"
dependencies = [
"harper-core",
"tree-sitter",
diff --cc harper-cli/Cargo.toml
index d1e48ef4f,3ecb8aa2a..e5b9c15d9
--- a/harper-cli/Cargo.toml
+++ b/harper-cli/Cargo.toml
@@@ -10,11 -10,11 +10,12 @@@ repository = "https://github.com/automa
anyhow = "1.0.97"
ariadne = "0.4.1"
clap = { version = "4.5.34", features = ["derive", "string"] }
- harper-stats = { path = "../harper-stats", version = "0.26.0" }
- harper-literate-haskell = { path = "../harper-literate-haskell", version = "0.26.0" }
- harper-core = { path = "../harper-core", version = "0.26.0" }
- harper-comments = { path = "../harper-comments", version = "0.26.0" }
- harper-typst = { path = "../harper-typst", version = "0.26.0" }
++harper-stats = { path = "../harper-stats", version = "0.27.0" }
+ dirs = "6.0.0"
+ harper-literate-haskell = { path = "../harper-literate-haskell", version = "0.27.0" }
+ harper-core = { path = "../harper-core", version = "0.27.0" }
+ harper-comments = { path = "../harper-comments", version = "0.27.0" }
+ harper-typst = { path = "../harper-typst", version = "0.27.0" }
hashbrown = "0.15.2"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
diff --cc harper-cli/src/main.rs
index 44aecd2b1,7af1ae874..c7706c04f
--- a/harper-cli/src/main.rs
+++ b/harper-cli/src/main.rs
@@@ -1,10 -1,9 +1,11 @@@
#![doc = include_str!("../README.md")]
-use std::collections::BTreeMap;
+use std::collections::{BTreeMap, HashMap};
+use std::fs::File;
+use std::io::BufReader;
- use std::path::{Path, PathBuf};
- use std::process;
+ use std::path::{Component, Path, PathBuf};
+ use std::sync::Arc;
+ use std::{fs, process};
use anyhow::format_err;
use ariadne::{Color, Label, Report, ReportKind, Source};
@@@ -13,11 -13,11 +15,11 @@@ use harper_comments::CommentParser
use harper_core::linting::{LintGroup, Linter};
use harper_core::parsers::{Markdown, MarkdownOptions};
use harper_core::{
- remove_overlaps, CharStringExt, Dialect, Dictionary, Document, FstDictionary,
- MutableDictionary, TokenKind, TokenStringExt, WordId,
+ remove_overlaps, CharStringExt, Dialect, Dictionary, Document, FstDictionary, MergedDictionary,
+ MutableDictionary, TokenKind, TokenStringExt, WordId, WordMetadata,
};
use harper_literate_haskell::LiterateHaskellParser;
-use hashbrown::HashMap;
+use harper_stats::Stats;
use serde::Serialize;
/// A debugging tool for the Harper grammar checker.
diff --cc harper-ls/Cargo.toml
index 49ca59c3a,a8e117082..8972a35c8
--- a/harper-ls/Cargo.toml
+++ b/harper-ls/Cargo.toml
@@@ -8,12 -8,11 +8,12 @@@ readme = "README.md
repository = "https://github.com/automattic/harper"
[dependencies]
- harper-literate-haskell = { path = "../harper-literate-haskell", version = "0.26.0" }
- harper-stats = { path = "../harper-stats", version = "0.26.0" }
- harper-core = { path = "../harper-core", version = "0.26.0", features = ["concurrent"] }
- harper-comments = { path = "../harper-comments", version = "0.26.0" }
- harper-typst = { path = "../harper-typst", version = "0.26.0" }
- harper-html = { path = "../harper-html", version = "0.26.0" }
++harper-stats = { path = "../harper-stats", version = "0.27.0" }
+ harper-literate-haskell = { path = "../harper-literate-haskell", version = "0.27.0" }
+ harper-core = { path = "../harper-core", version = "0.27.0", features = ["concurrent"] }
+ harper-comments = { path = "../harper-comments", version = "0.27.0" }
+ harper-typst = { path = "../harper-typst", version = "0.27.0" }
+ harper-html = { path = "../harper-html", version = "0.27.0" }
tower-lsp = "0.20.0"
tokio = { version = "1.44.1", features = ["fs", "rt", "rt-multi-thread", "macros", "io-std", "io-util", "net"] }
clap = { version = "4.5.34", features = ["derive"] }
diff --cc harper-stats/Cargo.toml
index 5ee455766,000000000..1eb18a8ca
mode 100644,000000..100644
--- a/harper-stats/Cargo.toml
+++ b/harper-stats/Cargo.toml
@@@ -1,19 -1,0 +1,19 @@@
+[package]
+name = "harper-stats"
- version = "0.26.0"
++version = "0.27.0"
+edition = "2021"
+
+[dependencies]
+serde = { version = "1.0.217", features = ["derive"] }
- harper-core = { path = "../harper-core", version = "0.26.0", features = ["concurrent"] }
++harper-core = { path = "../harper-core", version = "0.27.0", features = ["concurrent"] }
+uuid = { version = "1.12.0", features = ["serde", "v4"] }
+serde_json = "1.0.140"
+chrono = "0.4.40"
+
+[dev-dependencies]
+quickcheck = "1.0.3"
+quickcheck_macros = "1.0.0"
+
+[features]
+default = []
+js = ["uuid/js"]
diff --cc harper-wasm/Cargo.toml
index 60c60e822,9fab4a690..62db8cdaa
--- a/harper-wasm/Cargo.toml
+++ b/harper-wasm/Cargo.toml
@@@ -19,4 -19,3 +19,4 @@@ once_cell = "1.21.3
serde-wasm-bindgen = "0.6.5"
serde_json = "1.0.140"
serde = { version = "1.0.219", features = ["derive"] }
- harper-stats = { path = "../harper-stats", version = "0.26.0", features = ["js"] }
++harper-stats = { path = "../harper-stats", version = "0.27.0", features = ["js"] }