Skip to content

Feature Proposal: Accept multiple regex patterns for known-errors #193

@rubberduck203

Description

@rubberduck203

We've found that we will often have many known-errors with the same help text and fix, but different regex patterns.
This has led to a lot of duplication in our known errors.

Currently, the pattern property only accepts a single string.

        "pattern": {
          "description": "A Regex used to determine if the line is an error.",
          "type": "string"
        }

If we had a patterns property that took an array, we could specify multiple regexes and remove the duplication in our known-errors.

We could replace pattern with patterns, but that would be a breaking change.
The other option would be to accept OneOf either a string or array of strings,
which would be a backward compatible change, but would also leaves us with the awkwardness of having the property named pattern.

        "pattern": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            ]
        }

Obviously, we would need to update the code to loop through and look for any matching patterns.

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