/languagetool-lint

Lint CLI for languagetool.

Primary LanguageGoMIT LicenseMIT

GitHub Repo stars GitHub GitHub go.mod Go version GitHub all releases GitHub CI Status GitHub Release Status

languagetool-lint

Lint CLI for languagetool.

Requirements

Installation

$ go install github.com/skanehira/languagetool-lint@latest

Use as a lint tool

  1. Run your languagetool server in local.
    NOTE: You can use docker-languagetool to run languagetool server.
    $ docker run -d -p 8010:8010 erikvl87/languagetool
  2. Execute languagetool-lint like bellow.
    $ cat your_text_file
    When you type |:write|, then it would be executed in terminal, and
    you can choose any options(e.g add labels).
    
    $ languagetool-lint -a http://localhost:8081 -l "en-US" your_text_file
    your_text_file:2:27: The abbreviation “e.g.” (= for example) requires two periods.
  3. You can also use from stdin.
    $ echo "this is a pen." | languagetool-lint
    stdin:1:0: This sentence does not start with an uppercase letter.

Use as a Language Server

  1. Install efm-langserver
  2. Add config as bellow.
    version: 2
    tools:
      languagetool-lint: &languagetool-lint
        lint-command: 'languagetool-lint'
        lint-ignore-exit-code: true
        lint-stdin: true
        lint-formats:
          - '%f:%l:%c: %m'
    languages:
      markdown:
        - <<: *languagetool-lint
  3. Add your Language Client settings.
    e.g. coc.nvim
    call coc#config('languageserver', {
          \ 'efm': {
            \ 'command': 'efm-langserver',
            \ 'args': [],
            \ 'trace.server': 'verbose',
            \ 'filetypes': ['markdown']
            \ }
          \})

Author

skanehira

Thanks