<commit_before># -*- coding: utf-8 -*-
'''
    :codeauthor: :email:`<NAME> (<EMAIL>)`
    :copyright: © 2015 by the SaltStack Team, see AUTHORS for more details.
    :license: Apache 2.0, see LICENSE for more details.


    ===============================================
    PyLint Minimum Python Version Enforcing Checker
    ===============================================

    PyLint plugin which checks if the code meet the requirements of a targeted
    minimal version.
'''

# Import Python libs
from __future__ import absolute_import

# Import PyLint libs
from pylint.interfaces import IRawChecker
from saltpylint.checkers import BaseChecker

# Import 3rd-party libs
try:
    from saltpylint.ext import pyqver2
    HAS_PYQVER = True
except ImportError:
    import warnings  # pylint: disable=wrong-import-order
    warnings.warn(
        'Unable to import saltpylint.ext.pyqver. Running on Python 3? Checker skipped.',
        RuntimeWarning
    )
    HAS_PYQVER = False


class MininumPythonVersionChecker(BaseChecker):
    '''
    Check the minimal required python version
    '''

    __implements__ = IRawChecker

    name = 'mininum-python-version'
    msgs = {'E0598': ('Incompatible Python %s code found: %s',
                      'minimum-python-version',
                      'The code does not meet the required minimum python version'),
           }

    priority = -1

    options = (('minimum-python-version',<commit_msg>Fail to import saltpylint.ext.pyqver2 silently on Python 3<commit_after># -*- coding: utf-8 -*-
'''
    :codeauthor: :email:`<NAME> (<EMAIL>)`
    :copyright: © 2015 by the SaltStack Team, see AUTHORS for more details.
    :license: Apache 2.0, see LICENSE for more details.


    ===============================================
    PyLint Minimum Python Version Enforcing Checker
    ===============================================

    PyLint plugin which checks if the code meet the requirements of a targeted
    minimal version.
'''

# Import Python libs
from __future__ import absolute_import
import sys

# Import PyLint libs
from pylint.interfaces import IRawChecker
from saltpylint.checkers import BaseChecker

# Import 3rd-party libs
try:
    from saltpylint.ext import pyqver2
    HAS_PYQVER = True
except ImportError:
    if sys.version_info[0] == 2:
        import warnings  # pylint: disable=wrong-import-order
        warnings.warn(
            'Unable to import saltpylint.ext.pyqver2. Checker skipped.',
            RuntimeWarning
        )
    HAS_PYQVER = False


class MininumPythonVersionChecker(BaseChecker):
    '''
    Check the minimal required python version
    '''

    __implements__ = IRawChecker

    name = 'mininum-python-version'
    msgs = {'E0598': ('Incompatible Python %s code found: %s',
                      'minimum-python-version',
                      'The code does not meet the required minimum python version'),
           }

    priority = -1

    options = (('minimum-python-version',
{'fraction_non_alphanumeric': 0.14276116896204233, 'fraction_numerical': 0.011420893516963387, 'mean_word_length': 3.0517006802721087, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3705769', 'n_tokens_mistral': 867, 'n_tokens_neox': 812, 'n_words': 267}