Skip to content

Instantly share code, notes, and snippets.

@PharaohKJ
Created June 14, 2016 08:02
Show Gist options
  • Save PharaohKJ/cc849ad12ca613fec9604e5e91012ffc to your computer and use it in GitHub Desktop.
Save PharaohKJ/cc849ad12ca613fec9604e5e91012ffc to your computer and use it in GitHub Desktop.
textlint for emacs flycheck
;; ref https://github.com/amperser/proselint/issues/37
;; textlint
(flycheck-define-checker textlint
"A linter for prose."
:command ("textlint" "--format" "unix" "--rule" "no-mix-dearu-desumasu" "--rule" "max-ten" "--rule" "spellcheck-tech-word" source-inplace)
:error-patterns
((warning line-start (file-name) ":" line ":" column ": "
(id (one-or-more (not (any " "))))
(message (one-or-more not-newline)
(zero-or-more "\n" (any " ") (one-or-more not-newline)))
line-end))
:modes (text-mode markdown-mode gfm-mode))
(add-to-list 'flycheck-checkers 'textlint)
(add-hook 'gfm-mode-hook 'flycheck-mode)
(add-hook 'markdown-mode-hook 'flycheck-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment