Created
January 4, 2019 15:51
-
-
Save abrochard/f9dc0084290509af7f1ea371c62450b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'flycheck) | |
;; checkout https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html | |
;; | |
;; sudo npm install -g textlint write-good textlint-plugin-latex textlint-rule-write-good textlint-rule-no-start-duplicated-conjunction textlint-rule-max-comma textlint-rule-terminology textlint-rule-period-in-list-item textlint-rule-unexpanded-acronym textlint-rule-abbr-within-parentheses textlint-rule-alex textlint-rule-common-misspellings textlint-rule-en-max-word-count textlint-rule-diacritics textlint-rule-stop-words | |
(flycheck-define-checker textlint | |
"A linter for textlint." | |
:command ("textlint" | |
;; "--config" "/home/abrochard/.emacs.d/.textlintrc" | |
"--format" "unix" | |
"--rule" "write-good" | |
"--rule" "no-start-duplicated-conjunction" | |
"--rule" "max-comma" | |
"--rule" "terminology" | |
"--rule" "period-in-list-item" | |
"--rule" "abbr-within-parentheses" | |
"--rule" "alex" | |
"--rule" "common-misspellings" | |
"--rule" "en-max-word-count" | |
"--rule" "diacritics" | |
"--rule" "stop-words" | |
"--plugin" | |
(eval | |
(if (string= "tex" (file-name-extension buffer-file-name)) | |
"latex" | |
"@textlint/text")) | |
source-inplace) | |
:error-patterns | |
((warning line-start (file-name) ":" line ":" column ": " | |
(message (one-or-more not-newline) | |
(zero-or-more "\n" (any " ") (one-or-more not-newline))) | |
line-end)) | |
:modes (text-mode latex-mode org-mode markdown-mode) | |
) | |
(add-to-list 'flycheck-checkers 'textlint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment