from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.PipRequirement import PipRequirement


@linter(executable='scspell',
        use_stderr=True,
        output_format='regex',
        output_regex=r'(?P<filename>.*):(?P<line>.\d*):\s*(?P<message>.*)')
class SpellCheckBear:
    """
    Lints files to check for incorrect spellings using ``scspell``.

    See <https://pypi.python.org/pypi/scspell3k> for more information.
    """
    LANGUAGES = {'Natural Language'}
    REQUIREMENTS = {PipRequirement('scspell3k', '2.0')}
    AUTHORS = {'The coala developers'}
    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
    LICENSE = 'AGPL-3.0'
    ASCIINEMA_URL = 'https://asciinema.org/a/87753'
    CAN_DETECT = {'Spelling'}

    @staticmethod
    def create_arguments(filename, file, config_file):
        return '--report-only', filename

@@ -378,16 +378,441 @@
 ell%60%60.%0A%0A
+    scspell is a spell checker for source code.%0A    When applied to a code written in most popular programming languages%0A    while using most typical naming conventions, this algorithm will%0A    usually catch many errors without an annoying false positive rate.%0A%0A    In an effort to catch more spelling errors, scspell is able to%0A    check each file against a set of dictionary words selected%0A    specifically for that file.%0A%0A
     See 

Add Documentation