{"record":{"id":"dc095671401e6001","repo":"kovidgoyal/kitty","slug":"must-specify-at-least-two-points-for-the-linear-ea","errorCode":null,"errorMessage":"Must specify at least two points for the linear easing function","messagePattern":"Must specify at least two points for the linear easing function","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":1665,"sourceCode":"    def __repr__(self) -> str:\n        fields = ', '.join(f'{f}={getattr(self, f)!r}' for f in self._fields if getattr(self, f) != self._field_defaults[f])\n        return f'kitty.options.utils.EasingFunction({fields})'\n\n    def __bool__(self) -> bool:\n        return bool(self.type)\n\n    @classmethod\n    def cubic_bezier(cls, params: str) -> 'EasingFunction':\n        parts = params.replace(',', ' ').split()\n        if len(parts) != 4:\n            raise ValueError('cubic-bezier easing function must have four points')\n        return cls(type='cubic-bezier', cubic_bezier_points=(unit_float(parts[0]), float(parts[1]), unit_float(parts[2]), float(parts[3])))\n\n    @classmethod\n    def linear(cls, params: str) -> 'EasingFunction':\n        parts = params.split(',')\n        if len(parts) < 2:\n            raise ValueError('Must specify at least two points for the linear easing function')\n        xaxis: list[float] = []\n        yaxis: list[float] = []\n\n        def balance(end: float) -> None:\n            extra = len(yaxis) - len(xaxis)\n            if extra <= 0:\n                return\n            start = xaxis[-1] if xaxis else 0.0\n            delta = (end - start) / max(1, extra - 1)\n            if delta <= 0.0:\n                raise ValueError(f'Linear easing curve must have strictly increasing points: {params} does not')\n            if xaxis:\n                for i in range(extra):\n                    xaxis.append(start + (i + 1) * delta)\n            else:\n                for i in range(extra):\n                    xaxis.append(i * delta)\n","sourceCodeStart":1647,"sourceCodeEnd":1683,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1647-L1683","documentation":"EasingFunction.linear needs at least two comma-separated points to define a piecewise-linear curve; a single point or empty parameter string raises this ValueError.","triggerScenarios":"Specs like 'linear(0)' or 'linear()' in an animation/cursor_blink_interval value.","commonSituations":"Misunderstanding that one point can't define a curve; typos dropping the second coordinate.","solutions":["Provide at least two points, e.g. linear(0, 1) or linear(0, 0.5, 1)","Use a named easing if you just want simple behavior"],"exampleFix":"# before\ncursor_blink_interval 0.5:linear(0)\n# after\ncursor_blink_interval 0.5:linear(0, 1)","handlingStrategy":"validation","validationCode":"def valid_linear(params: str) -> bool:\n    return len(params.split(',')) >= 2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Minimum two comma-separated points"],"tags":["kitty","config","animation","easing"],"backgroundTag":"invalid-function-arguments","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}