<commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by <NAME>
# Copyright (c) 2016 <NAME>
#
# License: MIT
#

"""This module exports the Bashate plugin class."""

from SublimeLinter.lint import Linter
import os


class Bashate(Linter):
    """Provides an interface to bashate."""

    syntax = 'shell-unix-generic'
    cmd = 'bashate'
    comment_re = r'\s*#'
    regex = (
        r'^\[(?:(?P<error>E)|(?P<warning>W))\] E\d+: '
        r'(?P<message>.+): \'(?P<near>.+)?\'\n - '
        r'.+ : L(?P<line>\d+)'
    )
    multiline = True
    defaults = {
        '--ignore=,': '',
        '--warn=,': '',
        '--error=,': ''
    }
    tempfile_suffix = 'sh'
    check_version = False

    def tmpfile(self, cmd, code, suffix=''):
        """
        Run an external executable using a temp file to pass code and return its output.

        We override this to have the tmpfile extension match what is being
        linted so E005 is valid.
        """

        filename, extension = os.path.splitext(self.filename)
        extension = '.missingextension' if not extension else extension
        return super().tmpfile(cmd, code, extension)<commit_msg>Update from deprecated 'syntax' property to 'selector' setting Closes #17<commit_after>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by <NAME>
# Copyright (c) 2016 <NAME>
#
# License: MIT
#

"""This module exports the Bashate plugin class."""

from SublimeLinter.lint import Linter
import os


class Bashate(Linter):
    """Provides an interface to bashate."""

    cmd = 'bashate'
    comment_re = r'\s*#'
    regex = (
        r'^\[(?:(?P<error>E)|(?P<warning>W))\] E\d+: '
        r'(?P<message>.+): \'(?P<near>.+)?\'\n - '
        r'.+ : L(?P<line>\d+)'
    )
    multiline = True
    defaults = {
        'selector': 'source.shell.bash',
        '--ignore=,': '',
        '--warn=,': '',
        '--error=,': ''
    }
    tempfile_suffix = 'sh'
    check_version = False

    def tmpfile(self, cmd, code, suffix=''):
        """
        Run an external executable using a temp file to pass code and return its output.

        We override this to have the tmpfile extension match what is being
        linted so E005 is valid.
        """

        filename, extension = os.path.splitext(self.filename)
        extension = '.missingextension' if not extension else extension
        return super().tmpfile(cmd, code, extension)
{'fraction_non_alphanumeric': 0.15421494206951658, 'fraction_numerical': 0.007990411506192568, 'mean_word_length': 2.561877667140825, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '587267', 'n_tokens_mistral': 844, 'n_tokens_neox': 789, 'n_words': 240}