How to use the proselint.tools.consistency_check function in proselint

To help you get started, we’ve selected a few proselint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amperser / proselint / tests / test_consistency_check.py View on Github external
def test_smoke(self):
        """Basic smoke test for consistency_check."""
        assert chk(
            "Painting colour on color", self.l, self.err, self.msg) != []
        assert chk(
            "Painting colour on colour", self.l, self.err, self.msg) == []
        assert chk(
            "Painting color on color", self.l, self.err, self.msg) == []
github amperser / proselint / tests / test_consistency_check.py View on Github external
def test_smoke(self):
        """Basic smoke test for consistency_check."""
        assert chk(
            "Painting colour on color", self.l, self.err, self.msg) != []
        assert chk(
            "Painting colour on colour", self.l, self.err, self.msg) == []
        assert chk(
            "Painting color on color", self.l, self.err, self.msg) == []
github amperser / proselint / tests / test_consistency_check.py View on Github external
def test_smoke(self):
        """Basic smoke test for consistency_check."""
        assert chk(
            "Painting colour on color", self.l, self.err, self.msg) != []
        assert chk(
            "Painting colour on colour", self.l, self.err, self.msg) == []
        assert chk(
            "Painting color on color", self.l, self.err, self.msg) == []
github amperser / proselint / tests / test_consistency_check.py View on Github external
def this_check(self):
        """Boilerplate."""
        return chk
github amperser / proselint / proselint / checks / consistency / spacing.py View on Github external
def check(text):
    """Check the text."""
    err = "consistency.spacing"
    msg = "Inconsistent spacing after period (1 vs. 2 spaces)."

    regex = ["[\.\?!] [A-Z]", "[\.\?!]  [A-Z]"]
    return consistency_check(text, [regex], err, msg)
github amperser / proselint / proselint / checks / consistency / spelling.py View on Github external
["advisor", "adviser"],
        # ["analyse", "analyze"],
        ["centre", "center"],
        ["colour", "color"],
        ["emphasise", "emphasize"],
        ["finalise", "finalize"],
        ["focussed", "focused"],
        ["labour", "labor"],
        ["learnt", "learned"],
        ["organise", "organize"],
        ["organised", "organized"],
        ["organising", "organizing"],
        ["recognise", "recognize"],
    ]

    return consistency_check(text, word_pairs, err, msg)