{"record":{"id":"69a5d78deed4bc59","repo":"Textualize/textual","slug":"valid-rule-line-styles-are-friendly-list-valid-l","errorCode":null,"errorMessage":"Valid rule line styles are {friendly_list(_VALID_LINE_STYLES)}","messagePattern":"Valid rule line styles are (.+?)","errorType":"exception","errorClass":"InvalidLineStyle","httpStatus":null,"severity":"error","filePath":"src/textual/widgets/_rule.py","lineNumber":195,"sourceCode":"                f\"Valid rule orientations are {friendly_list(_VALID_RULE_ORIENTATIONS)}\"\n            )\n\n    def watch_orientation(\n        self, old_orientation: RuleOrientation, orientation: RuleOrientation\n    ) -> None:\n        self.remove_class(f\"-{old_orientation}\")\n        self.add_class(f\"-{orientation}\")\n\n    def validate_orientation(self, orientation: RuleOrientation) -> RuleOrientation:\n        if orientation not in _VALID_RULE_ORIENTATIONS:\n            raise InvalidRuleOrientation(\n                f\"Valid rule orientations are {friendly_list(_VALID_RULE_ORIENTATIONS)}\"\n            )\n        return orientation\n\n    def validate_line_style(self, style: LineStyle) -> LineStyle:\n        if style not in _VALID_LINE_STYLES:\n            raise InvalidLineStyle(\n                f\"Valid rule line styles are {friendly_list(_VALID_LINE_STYLES)}\"\n            )\n        return style\n\n    def get_content_width(self, container: Size, viewport: Size) -> int:\n        if self.orientation == \"horizontal\":\n            return container.width\n        return 1\n\n    def get_content_height(self, container: Size, viewport: Size, width: int) -> int:\n        if self.orientation == \"horizontal\":\n            return 1\n        return container.height\n\n    @classmethod\n    def horizontal(\n        cls,\n        line_style: LineStyle = \"solid\",","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/Textualize/textual/blob/06dbeef4bb70fb718236aa418ed658ef4667a126/src/textual/widgets/_rule.py#L177-L213","documentation":"Raised by Rule.validate_line_style reactive validator when line_style is not in _VALID_LINE_STYLES (e.g. 'solid', 'heavy', 'double', 'dashed', ... — see the module constants). Assignment of an unknown style raises InvalidLineStyle at set time.","triggerScenarios":"Rule(line_style='dotted') or rule.line_style = 'ascii' where those names are not in the valid set.","commonSituations":"Guessing style names, copying styles valid in CSS borders but not Rule, or Textual version differences in supported styles.","solutions":["Check _VALID_LINE_STYLES in textual/widgets/_rule.py and use an exact name (e.g. 'solid', 'heavy', 'dashed').","Avoid inventing styles; pick the closest valid one.","Pin/verify your Textual version's supported styles."],"exampleFix":"# before\nRule(line_style='dotted')\n# after\nRule(line_style='dashed')","handlingStrategy":"type-guard","validationCode":"from textual.widgets._rule import _VALID_LINE_STYLES\nassert style in _VALID_LINE_STYLES","typeGuard":"def is_line_style(s: str) -> bool: return s in _VALID_LINE_STYLES","tryCatchPattern":null,"preventionTips":["Use exact style names from _VALID_LINE_STYLES","Pin Textual version to keep style set stable"],"tags":["rule","line-style","validation","textual"],"backgroundTag":"invalid-enum-value","analyzedSha":"06dbeef4bb70fb718236aa418ed658ef4667a126","analyzedAt":"2026-08-27T02:36:57.214Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}