Skip to content

Commit

Permalink
Merge branch 'master' into wax
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Harris committed Mar 15, 2016
2 parents e4166fa + 33a96fe commit 5849981
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
8 changes: 4 additions & 4 deletions plugins/vim/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ syntastic's docs for help with this.
If you are a Vim user then you likely have a preferred way of managing
your plugins. Copy or link `syntastic_proselint` next to your other Vim
plugins, and enable it in your plugin manager. This should add `proselint`
as a syntastic checker for filetypes `asciidoc`, `docbk`, `help`, `html`,
`markdown`, `nroff`, `pod`, `rst`, `tex`, `texinfo`, `text`, and `xhtml`. If
you open a file of the relevant type and run `:SyntasticInfo`, you should see
`proselint` listed among the available checkers.
as a syntastic checker for filetypes `asciidoc`, `help`, `html`, `markdown`,
`nroff`, `pod`, `rst`, `tex`, `texinfo`, `text`, and `xhtml`. If you open a
file of the relevant type and run `:SyntasticInfo`, you should see `proselint`
listed among the available checkers.

Next, edit your `vimrc` and add `proselint` to
`g:syntastic_<filetype>_checkers` for the filetypes you plan to use, and
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@

let s:ft = expand('<sfile>:p:h:t', 1)

if exists('g:loaded_syntastic_' . s:ft . '_proselint_checker')
if exists('g:loaded_syntastic_' . s:ft . '_proselint_checker') || !exists('g:_SYNTASTIC_VERSION')
finish
endif
let g:loaded_syntastic_{s:ft}_proselint_checker = 1

if s:ft !=# 'text' && !syntastic#util#versionIsAtLeast(split(g:_SYNTASTIC_VERSION, '[.-]'), [3, 7, 0, 54])
execute 'runtime! syntax_checkers/text/*.vim'
execute 'runtime! syntax_checkers/' . s:ft . '/*.vim'
endif

if !exists('g:syntastic_' . s:ft . '_proselint_quiet_messages') && exists('g:syntastic_text_proselint_quiet_messages')
let g:syntastic_{s:ft}_proselint_quiet_messages = deepcopy(g:syntastic_text_proselint_quiet_messages)
endif
Expand Down
30 changes: 30 additions & 0 deletions proselint/checks/fowlers/inferior_superior.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""Inferior / Superior.
---
layout: post
source: Fowler's Modern English Usage
source_url: bit.ly/1YBG8QJ
title: Inferior / Superior
date: 2016-03-10 17:27:37
categories: writing
---
Corrects 'inferior/superior than' to 'inferior/superior to'.
"""
from proselint.tools import memoize, preferred_forms_check


@memoize
def check(text):
"""Suggest the preferred forms."""
err = "fowlers.inferior_superior"
msg = "'Inferior' and 'superior' are not true comparatives. Use '{}'."

preferences = [
["inferior to", ["inferior than"]],
["superior to", ["superior than"]],
]

return preferred_forms_check(text, preferences, err, msg)

0 comments on commit 5849981

Please sign in to comment.