<commit_before># This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import benchexec.result as result
import benchexec.tools.template


class Tool(benchexec.tools.template.BaseTool2):
    """
    Tool info for the witness checker (witnesslint)
    (https://github.com/sosy-lab/sv-witnesses)
    """

    def executable(self, tool_locator):
        return tool_locator.find_executable("witnesslint.py")

    def name(self):
        return "witnesslint"

    def determine_result(self, run):
        if run.exit_code.value == 0:
            return result.RESULT_TRUE_PROP
        else:
            return result.RESULT_FALSE_PROP
<commit_msg>Add version and distinguish linter error from faulty witness.<commit_after># This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import benchexec.result as result
import benchexec.tools.template


class Tool(benchexec.tools.template.BaseTool2):
    """
    Tool info for the witness checker (witnesslint)
    (https://github.com/sosy-lab/sv-witnesses)
    """

    def executable(self, tool_locator):
        return tool_locator.find_executable("witnesslint.py")

    def name(self):
        return "witnesslint"

    def version(self, executable):
        version_string = self._version_from_tool(executable)
        return version_string.partition("version")[2].strip().split(" ")[0]

    def determine_result(self, run):
        if run.exit_code.value == 0:
            return result.RESULT_TRUE_PROP
        elif run.exit_code.value == 1:
            return result.RESULT_FALSE_PROP
        else:
            return result.RESULT_ERROR

{'fraction_non_alphanumeric': 0.11012987012987013, 'fraction_numerical': 0.014025974025974027, 'mean_word_length': 3.270509977827051, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '5976768', 'n_tokens_mistral': 639, 'n_tokens_neox': 596, 'n_words': 131}