Skip to main content

Linter rules

Every rule moddef lint can report. Codes are stable identifiers:

  • MDE***: errors; a document that trips one is invalid (exit code 1).
  • MDW***: warnings; advisory, the document still validates (exit code 0).
  • PARSE_*: schema-level parse failures (unknown field, bad enum, malformed oneof).

See §28 Validation Rules for the normative descriptions, and the moddef CLI for running the linter.

Generated from the conformance fixtures. 38 rules.

Errors

CodeDescription
MDE001Document doc_id missing
MDE002Document version missing
MDE003Duplicate device profile id
MDE004Duplicate point id within a device profile
MDE301Overlapping register mappings (not overlay)
MDE302Point falls outside its register block range
MDE304length_words set on COIL mapping
MDE402Enum reference does not resolve
MDE405Scale denominator is zero
MDE406Composed mapping base is zero
MDE303Composed bit window exceeds its sub-mapping width
MDE408Composed mantissa/exponent bit windows overlap
MDE101Unknown measurand base_quantity
MDE102Point unit incompatible with measurand canonical unit
MDE005Duplicate enum id
MDE006Duplicate struct id
MDE007Duplicate measurand id
MDE403Struct reference does not resolve
MDE404String storage missing length/encoding
MDE501Command point missing write semantics
MDE502Duplicate command_id within a device profile
MDE503Command step reference does not resolve
MDE504Required command param never written by a step
MDE505length_ref target does not decode to an integer
MDE506Cyclic length_ref between two points
MDE507Poll condition structurally invalid (RANGE min > max)
MDE508Write step targets a READ_ONLY point

Warnings

CodeDescription
MDW001Multi-word value missing byte/word order
MDW002Missing description
MDW101Unknown unit string
MDW501Command declares no results
MDW003Duplicate human-readable names
MDW104Phase reference used for frequency
MDW301Suspicious 1-based Modicon address
MDW402Unused enum definition

Schema parse errors

CodeDescription
PARSE_ENUMInvalid enum value (access=READ)
PARSE_UNKNOWN_FIELDUnknown property (additionalProperties)
PARSE_ONEOFValueType with two oneof arms