loki.cli.tests.rules module

class CliDummyRule

Bases: GenericRule

Dummy rule for testing the loki-lint command line interface.

type = 2

The rule type as one of the categories in RuleType

docs = {'id': 'CLI.1', 'title': 'A dummy rule for testing the loki-lint CLI'}

dict with description of the rule

Typically, this should include "id" and "title". Allows for Python’s format specification mini-language in "title" to fill values using data from config, with the field name corresponding to the config key.

config = {'dummy_key': 'dummy value'}

Dict of configuration keys and their default values

These values can be overriden externally in the linter config file and are passed automatically to the check() routine.

classmethod check_file(sourcefile, rule_report, config)

Report source files whose name is marked as violating.