Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Lints #529

Merged
merged 14 commits into from
Jan 31, 2025
Merged

Ignore Lints #529

merged 14 commits into from
Jan 31, 2025

Conversation

elijah-potter
Copy link
Collaborator

@elijah-potter elijah-potter commented Jan 28, 2025

In conversations I've had about Harper (including in #364), a common request has been the ability to ignore individual lint results. I've avoided tackling this problem until now, since I was concerned it would disincentivize us from fixing false-positives in our rules. Now that we're rolling out more integrations, the context has shifted enough that this is now an important feature.

The Plan

I plan on making significant changes to the harper-core::linting module to make this happen.
The implementation should have a general-enough API that it can be consumed in harper-ls (as a code action), and consumers of harper.js.

We will store each lint to be ignored in a persistent manner, that is compatible with whatever client is consuming Harper.

This PR will remain a draft until completion.

@elijah-potter elijah-potter added enhancement New feature or request rust Pull requests that update Rust code obsidian-plugin Related to the Harper Obsidian integration harper-ls harper.js labels Jan 28, 2025
@elijah-potter elijah-potter changed the title refactor(core): separated types into their own modules Ignore Lints Jan 28, 2025
@elijah-potter elijah-potter marked this pull request as ready for review January 30, 2025 19:35
@elijah-potter
Copy link
Collaborator Author

elijah-potter commented Jan 30, 2025

To summarize what I've done:

I've introduced a structure (IgnoredLints) to organize, store and identify lints that have been previously marked as "ignored". I've the Linter type in harper.js (not to be confused with the Rust Linter type) composes IgnoredLints to allow JavaScript consumers to ignore lints in a privacy-respecting way, as well as store those settings as a string.

I then added UI for harper-ls and the Obsidian plugin to allow users to ignore lints. Right now, I've only added persistence to the Obsidian plugin, so if you ignore a lint in harper-ls and reopen the buffer, it will forget.

@elijah-potter elijah-potter merged commit 40f6138 into master Jan 31, 2025
4 checks passed
@elijah-potter elijah-potter deleted the ignore-lints branch January 31, 2025 15:49
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 6, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [Automattic/harper/harper-ls](https://github.com/Automattic/harper) | minor | `v0.18.1` -> `v0.19.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>Automattic/harper (Automattic/harper/harper-ls)</summary>

### [`v0.19.1`](https://github.com/Automattic/harper/releases/tag/v0.19.1)

[Compare Source](Automattic/harper@v0.18.1...v0.19.1)

#### What's Changed

The biggest change in this version: the ability to ignore lints. This is some pretty new code, so we hope to hear from you all to see how we can improve it.

-   feat: issue templates by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#539
-   feat(core): even more holidays by [@&#8203;hippietrail](https://github.com/hippietrail) in Automattic/harper#533
-   feat(core): implement "despite of" lint by [@&#8203;hippietrail](https://github.com/hippietrail) in Automattic/harper#531
-   feat(html): condense spaces like most HTML parsers by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#546
-   Ignore Lints by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#529
-   fix(core): [#&#8203;548](Automattic/harper#548) `you` is not a verb by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#551
-   docs: mention [#&#8203;536](Automattic/harper#536) on installation pages by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#538
-   Site fixes and updates by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#552
-   feat(core): created framework for correcting common phrases by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#550
-   feat(core): condense multi-token Latin words and phrases by [@&#8203;elijah-potter](https://github.com/elijah-potter) in Automattic/harper#473

**Full Changelog**: Automattic/harper@v0.18.1...v0.19.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjEuNiIsInVwZGF0ZWRJblZlciI6IjM5LjE2MS42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request harper.js harper-ls obsidian-plugin Related to the Harper Obsidian integration rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant