14.2. Repo-level lint configuration
The lint_config module loads {get_das_root()}/.lint_config (a TOML
file with a [rules] table of booleans) and folds it into a
disabled_codes set consumed by the three lint pass-macros
(daslib/lint, daslib/perf_lint, daslib/style_lint), by the
standalone runner utils/lint/main.das, and by the MCP lint tool.
seed_default_disabled seeds the canonical default-off rule set
(currently STYLE005) before the file is read.
All functions and symbols are in “lint_config” module, use require to get access to it.
require daslib/lint_config
14.2.1. Constants
- LINT_SKIP_HEADER_LINES = 16
LINT_SKIP_HEADER_LINES:int const
14.2.2. Structures
- LintIssue
- Fields:
code : string - < rule id (“LINT002”, “PERF018”, “STYLE005”); “” when the message carries none
message : string - < message text without the position suffix; may be multi-line (instanced-from chains)
file : string - < source file as spelled by the compiler; “” when the location has no file info
line : int - < 1-based start line
column : int - < 0-based start column (byte offset — the LineInfo convention)
last_line : int - < 1-based end line; 0 when unknown
last_column : int - < 0-based end column (byte offset, end-exclusive)
14.2.3. Configuration
- build_lint_macro_disabled(prog: ProgramPtr ): table<string, void>
def build_lint_macro_disabled (prog: ProgramPtr) : table<string, void>
- Arguments:
prog : ProgramPtr
- lint_config_forces_on(code: string ): bool
def lint_config_forces_on (code: string) : bool
- Arguments:
code : string
- load_env_disabled(disabled_codes: table<string, void> )
def load_env_disabled (var disabled_codes: table<string, void>)
- Arguments:
disabled_codes : table<string;void>
- load_lint_config(disabled_codes: table<string, void> )
def load_lint_config (var disabled_codes: table<string, void>)
- Arguments:
disabled_codes : table<string;void>
- load_lint_config_from_path(path: string; disabled_codes: table<string, void> )
def load_lint_config_from_path (path: string; var disabled_codes: table<string, void>)
- Arguments:
path : string
disabled_codes : table<string;void>
- seed_default_disabled(disabled_codes: table<string, void> )
def seed_default_disabled (var disabled_codes: table<string, void>)
- Arguments:
disabled_codes : table<string;void>
14.2.4. Path excludes
- is_lint_path_excluded(file: string ): bool
def is_lint_path_excluded (file: string) : bool
- Arguments:
file : string
- load_path_excludes_from_path(path: string; excludes: array<string> )
def load_path_excludes_from_path (path: string; var excludes: array<string>)
- Arguments:
path : string
excludes : array<string>
- matches_path_excludes(file: string; excludes: array<string> ): bool
def matches_path_excludes (file: string; excludes: array<string>) : bool
- Arguments:
file : string
excludes : array<string>
14.2.5. Path-based rule defaults
- is_core_library_source(prog: ProgramPtr ): bool
def is_core_library_source (prog: ProgramPtr) : bool
- Arguments:
prog : ProgramPtr
- is_daslib_source(prog: ProgramPtr ): bool
def is_daslib_source (prog: ProgramPtr) : bool
- Arguments:
prog : ProgramPtr
- is_shipped_library_source(prog: ProgramPtr ): bool
def is_shipped_library_source (prog: ProgramPtr) : bool
- Arguments:
prog : ProgramPtr
14.2.6. Lint-surface predicates
- is_lint_fixture_name(base: string ): bool
def is_lint_fixture_name (base: string) : bool
- Arguments:
base : string
- is_user_authored_body(fn: Function? ): bool
def is_user_authored_body (fn: Function?) : bool
- Arguments:
fn : Function?
- lint_file_skip_reason(file: string ): string
def lint_file_skip_reason (file: string) : string
- Arguments:
file : string
14.2.7. Structured findings
- make_lint_issue(message: string; at: LineInfo ): LintIssue
def make_lint_issue (message: string; at: LineInfo) : LintIssue
- Arguments:
message : string
at : LineInfo