class ConventionConfig

Overview

Runtime config passed to convention rules. Loaded from .lint_conventions.yml at the repo root (or defaults) by the runner.

Today only #view_subclass_approved_roots is configurable; future rules can read additional fields without changing the constructor signature.

Defined in:

lsp_rules/convention_rule.cr

Constant Summary

DEFAULT_VIEW_SUBCLASS_APPROVED_ROOTS = ["src/ui/views/", "samples/"]

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.load(path : String) : ConventionConfig #

Loads config from a YAML file at path, falling back to defaults for any missing key. Returns a fresh ConventionConfig with the union of file values + defaults.


[View source]
def self.new(view_subclass_approved_roots : Array(String) = DEFAULT_VIEW_SUBCLASS_APPROVED_ROOTS.dup) #

[View source]

Class Method Detail

def self.parse_yaml_string_list(text : String, dotted_key : String) : Array(String) #

Tiny inline YAML parser sufficient for the keys we need (a flat key: section with a nested subkey: [a, b] inline list OR a block list of - value lines). Avoids pulling in the full YAML shard at compile time — the runner is a single crystal run.


[View source]

Instance Method Detail

def view_subclass_approved_roots : Array(String) #

[View source]
def view_subclass_approved_roots=(view_subclass_approved_roots : Array(String)) #

[View source]