Skip to main content

Lint Config Files

The command line tool will lint all *.config files. Rules are placed in the rules.py file.

Rules to lint config files are decorated with @configrule. For example:

@configrule
def must_use_closures(config: ConfigFile, results: LintResults):
"""All directives that use params must be nested in a closure"""
for process_scope in config.process_scopes:
for directive in process_scope.directives:
error = directive_violating(directive)
if error:
results.errors.append(error)
for named_scope in process_scope.named_scopes:
for directive in named_scope.directives:
error = directive_violating(directive)
if error:
results.errors.append(error)

For more information, see the API docs.