How to use the xiblint.rules function in xiblint

To help you get started, we’ve selected a few xiblint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lyft / xiblint / xiblint / __main__.py View on Github external
def make_epilog_text():
    import xiblint.rules
    description = "Lint rules:\n"

    for rule_name in sorted(xiblint.rules.rule_checkers.keys()):
        checker = xiblint.rules.rule_checkers[rule_name]
        description += "\t{}\n".format(rule_name)
        doc = checker.__doc__
        if doc is not None:
            for line in doc.strip().split("\n"):
                description += " " * 24 + "{}\n".format(line.strip())

    return description
github lyft / xiblint / xiblint / __main__.py View on Github external
def make_epilog_text():
    import xiblint.rules
    description = "Lint rules:\n"

    for rule_name in sorted(xiblint.rules.rule_checkers.keys()):
        checker = xiblint.rules.rule_checkers[rule_name]
        description += "\t{}\n".format(rule_name)
        doc = checker.__doc__
        if doc is not None:
            for line in doc.strip().split("\n"):
                description += " " * 24 + "{}\n".format(line.strip())

    return description
github lyft / xiblint / xiblint / config.py View on Github external
def validate_rule_patterns(patterns):
    for pattern in (patterns or []):
        if not any(fnmatch(key, pattern) for key in xiblint.rules.rule_checkers):
            print("Warning: Rule pattern '{}' matches no rules".format(pattern))