<commit_before>import logging

from taskcat._cfn_lint import Lint as TaskCatLint
from taskcat._config import Config
from taskcat.exceptions import TaskCatException

LOG = logging.getLogger(__name__)


class Lint:
    """checks CloudFormation templates for issues using cfn-python-lint"""

    def __init__(self, input_file: str, project_root: str = "./", strict: bool = False):
        """
        :param input_file: path to project config or CloudFormation template
        :param project_root: base path for project
        :param strict: fail on lint warnings as well as errors
        """
        config = Config(
            project_config_path=input_file,
            project_root=project_root,
            create_clients=False,
        )
        lint = TaskCatLint(config, strict)
        errors = lint.lints[1]
        lint.output_results()
        if errors or not lint.passed:
            raise TaskCatException("Lint failed with errors")<commit_msg>make input file optional default to default config file name in current working directory<commit_after>import logging

from taskcat._cfn_lint import Lint as TaskCatLint
from taskcat._config import Config
from taskcat.exceptions import TaskCatException

LOG = logging.getLogger(__name__)


class Lint:
    """checks CloudFormation templates for issues using cfn-python-lint"""

    def __init__(
        self,
        input_file: str = "./.taskcat.yml",
        project_root: str = "./",
        strict: bool = False,
    ):
        """
        :param input_file: path to project config or CloudFormation template
        :param project_root: base path for project
        :param strict: fail on lint warnings as well as errors
        """
        config = Config(
            project_config_path=input_file,
            project_root=project_root,
            create_clients=False,
        )
        lint = TaskCatLint(config, strict)
        errors = lint.lints[1]
        lint.output_results()
        if errors or not lint.passed:
            raise TaskCatException("Lint failed with errors")
{'fraction_non_alphanumeric': 0.07400194741966894, 'fraction_numerical': 0.0009737098344693282, 'mean_word_length': 2.669642857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6247614', 'n_tokens_mistral': 559, 'n_tokens_neox': 545, 'n_words': 178}