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

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

from SublimeLinter.lint import Linter, util


class AnsibleLint(Linter):
    """Provides an interface to ansible-lint."""

    syntax = 'ansible'
    cmd = ('ansible-lint', '-p', '--nocolor', '@')
    executable = None
    version_args = '--version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 3.0.1'
    regex = r'.+:(?P<line>\d+):.+\] (?P<message>.+)'
    multiline = True
    line_col_base = (1, 1)
    tempfile_suffix = 'yml'
    error_stream = util.STREAM_STDOUT
    selectors = {}
    word_re = None
    defaults = {
        '-r:,': '',
        '-R:,': '',
        '-t:,': '',
        '-x:,': '',
        '--exclude=,': ''
    }
    inline_settings = ('r', 'R', 't', 'x', 'exclude')
    inline_overrides = ('r', 'R', 't', 'x', 'exclude')
    comment_re = r'\s*#'
<commit_msg>Fixes for sublime linter 4<commit_after>#
# linter.py
# Linter for SublimeLinter4, a code checking framework for Sublime Text 3
#
# Written by <NAME>
# Copyright (c) 2017 <NAME>
#
# License: MIT
#

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

from SublimeLinter.lint import Linter, util


class AnsibleLint(Linter):
    """Provides an interface to ansible-lint."""

    # ansbile-lint verison requirements check
    version_args = '--version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 3.0.1'

    # linter settings
    cmd = ('ansible-lint', '${args}', '${file}')
    regex = r'.+:(?P<line>\d+): \[(?P<error>.z+)\] (?P<message>.+)'
    # -p generate non-multi-line, pep8 compatible output
    multiline = False

    # ansible-lint does not support column number
    word_re = False
    line_col_base = (1, 1)

    tempfile_suffix = 'yml'
    error_stream = util.STREAM_STDOUT
    defaults = {
        'selector': 'source.ansible',
        'args': '-p'
    }

{'fraction_non_alphanumeric': 0.18496827720839434, 'fraction_numerical': 0.01171303074670571, 'mean_word_length': 2.9272030651340994, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 16, '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': '7071735', 'n_tokens_mistral': 778, 'n_tokens_neox': 734, 'n_words': 183}