emacs-languagetool / flymake-languagetool

Flymake support for LanguageTool
GNU General Public License v3.0
36 stars 11 forks source link

Incremental Checks #23

Open tpeacock19 opened 9 months ago

tpeacock19 commented 9 months ago

Hello @jcs090218, I am working on a feature to only send snippets of text to languagetool instead of the entire buffer. I wanted to see if you could test out the feat/incremental-checking branch and let me know if you have any feedback or notice any issues. I appreciate any insight you can provide!

jcs090218 commented 9 months ago

LGTM! I suggest you open a PR so it's easier for people to review. :)

jcubic commented 9 months ago

@tpeacock19 Will this fix the limit of number of characters send the API? Just got an issue with long file and the web editor have even smaller character limit.

jcs090218 commented 9 months ago

I've added the .dir-locals.el to the master branch. Can you rebase it to your branch? :)

There are things I want to point out. I'm using Eask to keep up the maintenance of this package. There are two generic linters (package-lint and checkdoc), and I hope you can eliminate these warnings/errors.

With eask lint checkdoc and Emacs 29.2:

`flymake-languagetool.el` with checkdoc (0.6.2)

flymake-languagetool.el:79: First sentence should end with punctuation
flymake-languagetool.el:84: First sentence should end with punctuation
flymake-languagetool.el:179: Documentation strings should not start or end with whitespace
flymake-languagetool.el:179: First sentence should end with punctuation
flymake-languagetool.el:179: There should be two spaces after a period
flymake-languagetool.el:184: Documentation strings should not start or end with whitespace
flymake-languagetool.el:184: First sentence should end with punctuation
flymake-languagetool.el:184: There should be two spaces after a period
flymake-languagetool.el:286: Documentation strings should not start or end with whitespace
flymake-languagetool.el:286: First sentence should end with punctuation
flymake-languagetool.el:286: Argument `source-buffer' should appear (as SOURCE-BUFFER) in the doc string
flymake-languagetool.el:286: There should be two spaces after a period
flymake-languagetool.el:318: Argument `report-fn' should appear (as REPORT-FN) in the doc string
flymake-languagetool.el:382: Argument `report-fn' should appear (as REPORT-FN) in the doc string
flymake-languagetool.el:425: Argument `format' should appear (as FORMAT) in the doc string
flymake-languagetool.el:469: Argument `ov' should appear (as OV) in the doc string
flymake-languagetool.el:484: Argument `ov' should appear (as OV) in the doc string
flymake-languagetool.el:584: First sentence should end with punctuation

With eask lint package and Emacs 29.2:

`flymake-languagetool.el` with package-lint (20240220.2303)
1 issue found:

233:33: error: You should depend on (emacs "28.1") or the compat package if you need `string-replace'.

I've bumped the minimum version to (emacs "28.1") on the master branch for now since it seems like it won't work on 27.x. 🤔

tpeacock19 commented 9 months ago

I've added the .dir-locals.el to the master branch. Can you rebase it to your branch? :)

Yep, I will start using that now.

I've bumped the minimum version to (emacs "28.1") on the master branch for now since it seems like it won't work on 27.x.

I don't think you should remove 27.x support. We can simply add compat as a dependency and it should be fine.

jcs090218 commented 9 months ago

I don't think you should remove 27.x support. We can simply add compat as a dependency and it should be fine.

That will work too! Or use s-replace from s.el. 😁