Skip to content

Result model: path indices, {{value}}, and function errors #14

Open

Description

@kinlane

How results report locations and values, and what happens when a function fails.

Related: #31 Tracing why a rule has fired.

Open questions in the draft:

  • Results (draft line 1110): Indices in path are strings, ["names", "1"], as OpenLint reports them. Numbers would tell an index apart from a key that happens to be numeric.
  • The message (draft line 1135): {{value}} substitutes a string as it is and an object as [object Object], which no ruleset wants. A JSON serialization of the value would be useful, and is a change in output.
  • The contract (draft line 1549): A function that throws, or returns something that is not a list of problems, ends the run with no results and an error. Reporting it as a result for the rule, with the error as its message, would keep the results of the other rules.

Part of the work to resolve the draft's open questions (discussion #13). AI use: Claude grouped the draft's inline issues and drafted this issue at Kin's request; the questions are quoted from the spec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions