404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.118.212.28: ~ $
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from typing import List

from cfnlint.config import configure_logging
from cfnlint.core import get_rules
from cfnlint.decode import decode_str
from cfnlint.helpers import REGIONS
from cfnlint.rules import Match, RulesCollection
from cfnlint.runner import Runner

Matches = List[Match]


def lint(s: str, rules: RulesCollection, regions: List[str]) -> Matches:
    """Validate a string template using the specified rules and regions.

    Parameters
    ----------
    s : str
        the template string
    rules : RulesCollection
        The rules to run against s
    regions : List[str]
        The regions to test against s

    Returns
    -------
    list
        a list of errors if any were found, else an empty list
    """
    configure_logging(None, None)
    template, errors = decode_str(s)
    if errors:
        return errors

    if template is None:
        return []

    runner = Runner(
        rules=rules,
        filename=None,
        template=template,
        regions=regions,
        verbosity=0,
        mandatory_rules=None,
    )
    runner.transform()
    return runner.run()


def lint_all(s: str) -> Matches:
    """Validate a string template against all regions and rules.

    Parameters
    ----------
    s : str
        the template string

    Returns
    -------
    list
        a list of errors if any were found, else an empty list
    """
    return lint(
        s=s,
        rules=get_rules([], [], ["I", "W", "E"], include_experimental=True),
        regions=REGIONS,
    )

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
conditions Folder 0755
data Folder 0755
decode Folder 0755
decorators Folder 0755
formatters Folder 0755
rules Folder 0755
template Folder 0755
__init__.py File 2.47 KB 0644
__main__.py File 1.78 KB 0644
api.py File 1.59 KB 0644
config.py File 26.56 KB 0644
core.py File 11.02 KB 0644
exceptions.py File 592 B 0644
graph.py File 10.85 KB 0644
helpers.py File 21.95 KB 0644
languageExtensions.py File 1.98 KB 0644
maintenance.py File 18.87 KB 0644
runner.py File 3.93 KB 0644
transform.py File 8.48 KB 0644
version.py File 130 B 0644