Skip to content

Refine diagnosticFilters #1060

@TwitchBronBron

Description

@TwitchBronBron

DiagnosticFilters is a bit weird.
if you give it numbers, those apply to only bsc diagnostics.
If you give it strings, those apply to a relative srcPath to the actual source files.
you have to use {codes: []} to target string-based diagnostics.

This is a breaking change. I think we should modify the diagnosticFilters accordingly:

  • top-level integers and strings should be diagnostic codes which are used to filter the entire project. Internally, they are mapped to { codes: []}
  • we should support specifying the string style of bsc diagnostics (i.e. "bs1234") in addition to 1234...but maybe we should disable the pure integer version entirely since that's not how they're printed...ever
  • if you want to ignore files, you can specify a files section in the object, which follows the same rules as the outer files array.

Here's an example bsconfig with these options applied:

"diagnosticFilters": [
    1001,
    "bs1002",
    "lint1003",
    {
        "codes": [
            1004,
            "bs1005",
            "lint1006"
        ]
    },
    {
        "files": [
            // a srcPath that is also a destPath
            "source/common.brs",
            {
                "src": "../themes/theme1/**/*"
            }
        ]
    },
    {
        "files": "**/roku_modules/**/*",
        //exclude certain codes from certain files
        "codes": [
            1200,
            "bs1201"
        ]
    }
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions