statix icon indicating copy to clipboard operation
statix copied to clipboard

suggestion: add `option_missing_docs` lint

Open rrvsh opened this issue 1 month ago • 0 comments

i'd like to suggest adding a new lint, option_missing_docs, to warn about under-documented uses of lib.options.mkOption.

The lint should trigger for option attribute sets (_type == "option") that are not marked internal = true and not hidden (visible != false) when either description is missing, or none of default, defaultText, or example are provided.

Triggers lint

mkOption {
  type = types.str;
}
mkOption {
  description = "Port to listen on";
  type = types.int;
}

Does not trigger

mkOption {
  description = "Port to listen on";
  default = 8080;
}
mkOption {
  internal = true;
  type = types.str;
}
mkOption {
  visible = false;
  type = types.str;
}

rrvsh avatar Dec 13 '25 03:12 rrvsh