Cette page n’est pas encore traduite. Elle est affichée en anglais.

Référence

Diagnostics

Every problem dsfc reports has a stable ID such as DSF-T001, a severity and a source position.

design-system.dsf:21:20: error DSF-T002: `length * length` is not defined
design-system.dsf:22:20: error DSF-T001: expected length, found integer
2 error(s), 0 warning(s)

Each line is file:line:column: severity ID: message. The position is 1-based and points at the construct the registry names for that ID. Severities are error, warning and info. Any error makes the command exit with status 1; warnings and infos do not.

IDs

An ID is DSF- followed by a family letter and a number. IDs are stable: an ID is never reused for another meaning, and retired IDs stay listed.

Family Area Example
S Syntax DSF-S001 HCL syntax error
P Package, paths, project file DSF-P007 invalid dsf.hcl
N Names and declarations DSF-N004 unresolved reference
T Types and expressions DSF-T001 type mismatch
K Tokens and resolver DSF-K006 token missing in a resolver permutation
C Components, instances, slots DSF-C009 instantiation cycle
O Overrides DSF-O001 conflicting overrides
B Behavior DSF-B003 activation reachable while disabled
A Accessibility DSF-A003 contrast below the WCAG threshold (warning)
R Resources and assets DSF-R008 icon digest missing or not matching
X Target capabilities DSF-X001 unsupported by the target, no fallback; DSF-X004 realized only in part (a warning)
Y Layout DSF-Y002 content certainly overflows a node of bounded size (warning)
L Evaluation limits DSF-L001 limit exceeded
U Usage rules DSF-U001 rule violated
E Examples DSF-E001 expectation failed
G Compiler limits and internals DSF-G002 valid construct this version cannot represent (e.g. px(…) tokens); DSF-G001 precondition failed (a compiler bug)

Syntax the language reserves but the compiler does not support yet is reported as DSF-N007 (“proposed construct not supported”), never ignored.

Warnings

A warning reports a likely problem without failing the command. The contrast check is one:

design-system.dsf:35:9: warning DSF-A003: text `label` of Hint: #9e9e9e on #ffffff is 2.68:1, below 4.5:1 (WCAG 2.2 SC 1.4.3); in Hint default configuration
0 error(s), 1 warning(s)

The layout stage warns when content certainly does not fit a node of bounded size that does not clip it (DSF-Y002), counting only lengths, icons, gaps, padding and line heights, never text widths, which depend on fonts:

design-system.dsf:34:9: warning DSF-Y002: the content of stack `row` of Toolbar needs at least 136dp of width, padding included, but the node is at most 100dp; it overflows (set `overflow = "clip"` if it is meant to be cut); in Toolbar default configuration

Infos report a decision, such as DSF-K014 for the values a materialized DTCG export wrote as literals.

JSON output

dsfc check . --format json
{
  "diagnostics": [
    {
      "id": "DSF-T002",
      "severity": "error",
      "message": "`length * length` is not defined",
      "location": { "file": "design-system.dsf", "line": 21, "column": 20 }
    }
  ],
  "ok": false,
  "checked": ["manifest", "sources", "syntax", "tokens", "…"],
  "not_checked": ["capabilities"]
}

Full registry

The registry, with the meaning and source span of every ID and the IDs proposed but not yet assigned, is spec/diagnostics.md.

Modifier cette page sur GitHub