You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: harper-core/src/linting/mod.rs
+22
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
//! Frameworks and rules that locate errors in text.
2
+
//!
3
+
//! See the [`Linter`] trait and the [documentation for authoring a rule](https://writewithharper.com/docs/contributors/author-a-rule) for more information.
4
+
1
5
mod an_a;
2
6
mod avoid_curses;
3
7
mod boring_words;
@@ -73,15 +77,33 @@ pub use wrong_quotes::WrongQuotes;
73
77
74
78
usecrate::Document;
75
79
80
+
/// A __stateless__ rule that searches documents for grammatical errors.
81
+
///
82
+
/// Commonly implemented via [`PatternLinter`].
83
+
///
84
+
/// See also: [`LintGroup`].
76
85
#[cfg(not(feature = "concurrent"))]
77
86
pubtraitLinter{
87
+
/// Analyzes a document and produces zero or more [`Lint`]s.
88
+
/// We pass `self` mutably for caching purposes.
78
89
fnlint(&mutself,document:&Document) -> Vec<Lint>;
90
+
/// A user-facing description of what kinds of grammatical errors this rule looks for.
91
+
/// It is usually shown in settings menus.
79
92
fndescription(&self) -> &str;
80
93
}
81
94
95
+
/// A __stateless__ rule that searches documents for grammatical errors.
96
+
///
97
+
/// Commonly implemented via [`PatternLinter`].
98
+
///
99
+
/// See also: [`LintGroup`].
82
100
#[cfg(feature = "concurrent")]
83
101
pubtraitLinter:Send + Sync{
102
+
/// Analyzes a document and produces zero or more [`Lint`]s.
103
+
/// We pass `self` mutably for caching purposes.
84
104
fnlint(&mutself,document:&Document) -> Vec<Lint>;
105
+
/// A user-facing description of what kinds of grammatical errors this rule looks for.
Copy file name to clipboardexpand all lines: packages/web/src/routes/docs/contributors/author-a-rule/+page.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -150,18 +150,18 @@ If you need any help writing or debugging rules, don't be afraid to contact the
150
150
### Using Visual Studio Code
151
151
152
152
First make sure you have [the extension installed from the marketplace](https://marketplace.visualstudio.com/items?itemName=elijah-potter.harper).
153
-
Then, can configure the path of the `harper-ls` binary the Visual Studio Code extension uses in settings.
153
+
Then, configure the path of the `harper-ls` binary the Visual Studio Code extension uses in the settings page.
154
154
Set it to `<harper repo>/target/release/harper-ls`.
155
155
156
156

157
157
158
-
Now every time you want to test a change, you'll have to recompile `harper-ls` and reload Visual Studio Code using `Developer: Reload Window`.
158
+
Every time you want to test a change, you'll have to recompile `harper-ls` and reload Visual Studio Code with the `Developer: Reload Window` command in the command palette.
159
159
160
160
```bash
161
161
cargo build --release # Run in the monorepo to compile `harper-ls`.
162
162
```
163
163
164
164
## Elevate Your Pull Request
165
165
166
-
Once you're satisfied with your rule, you can go ahead and elevate your pull requests to mark it as "ready for review."
166
+
Once you're satisfied with your rule, you can go ahead and elevate your pull request to mark it as "ready for review."
167
167
At that point, a maintainer on the Harper team take a look at it and (hopefully) merge it.
0 commit comments