Skip to content

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

fix: issues with precommit

Elijah Potteredfa2e79f37a
diff --git a/demo.md b/demo.md
index 72adbd7ba..cef0b1738 100644
--- a/demo.md
+++ b/demo.md
@@ -2,7 +2,8 @@ There are some cases where the the standard grammar checkers
don't cut it. That s where Harper comes in handy.
Harper is an language checker for developers. it can detect
-improper capitalization and misspellled words.
+improper capitalization and misspellled words, as well as a number of other issues.
+Like if you break up words you shouldn't.
Harper works everywhere, even offline. Since you r data
never leaves your device, you don't ned to worry aout us
diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs
index 72d545f6b..5ed8b8f19 100644
--- a/harper-core/src/linting/matcher.rs
+++ b/harper-core/src/linting/matcher.rs
@@ -139,7 +139,6 @@ impl Matcher {
"the","challenged" => "that challenged",
"stdin" => "standard input",
"stdout" => "standard output",
- "your","doing" => "you're doing",
"no","to" => "not to",
"No","to" => "not to",
"ngram" => "n-gram",
@@ -190,6 +189,8 @@ impl Matcher {
"then","his" => "than his",
"simply","grammatical" => "simple grammatical",
"you","r" => "your",
+ "you","re" => "you're",
+ "you","re" => "you are",
"that","s" => "that's",
"That","s" => "That's",
"that","s" => "that is",
diff --git a/justfile b/justfile
index f929ca89d..4ec88bd77 100644
--- a/justfile
+++ b/justfile
@@ -1,3 +1,4 @@
+# Format both Rust and JavaScript
format:
cargo +nightly fmt
cd {{justfile_directory()}}/packages; yarn prettier -w .
@@ -6,6 +7,7 @@ format:
build-wasm target:
cd {{justfile_directory()}}/harper-wasm && wasm-pack build --target {{target}}
+# Compile the web demo's dependencies and start a development server. Note that if you make changes to `harper-wasm`, you will have to re-run this command.
dev-web:
#! /bin/bash
set -eo pipefail
@@ -23,7 +25,6 @@ build-web:
cd {{justfile_directory()}}/packages/web
yarn install -f
- yarn run check
yarn run build
build-obsidian:
@@ -38,12 +39,28 @@ build-obsidian:
zip harper-obsidian-plugin.zip manifest.json main.js
-precommit:
+check:
#! /bin/bash
set -eo pipefail
cargo +nightly fmt --check
cargo clippy -- -Dwarnings
+
+ cd {{justfile_directory()}}/packages
+ yarn install
+ yarn prettier --check .
+ yarn eslint .
+
+ cd web
+ just build-web
+ yarn run check
+
+precommit:
+ #! /bin/bash
+ set -eo pipefail
+
+ just check
+
cargo test
cargo test --release
cargo doc
@@ -51,10 +68,5 @@ precommit:
cargo build --release
cargo bench
- cd {{justfile_directory()}}/packages
- yarn install
- yarn prettier --check .
- yarn eslint .
-
just build-obsidian
just build-web
diff --git a/packages/web/src/lib/Underlines.svelte b/packages/web/src/lib/Underlines.svelte
index e929665a0..a547a9d91 100644
--- a/packages/web/src/lib/Underlines.svelte
+++ b/packages/web/src/lib/Underlines.svelte
@@ -5,7 +5,7 @@
// For now, it works.
import { lintText } from '$lib/analysis';
- import { Lint } from 'wasm';
+ import type { Lint } from 'wasm';
export let content: string;
export let focusLintIndex: number | undefined;