Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag path-like codes in diagnosticFilters #1384

Open
TwitchBronBron opened this issue Dec 23, 2024 · 1 comment
Open

Flag path-like codes in diagnosticFilters #1384

TwitchBronBron opened this issue Dec 23, 2024 · 1 comment
Milestone

Comments

@TwitchBronBron
Copy link
Member

TwitchBronBron commented Dec 23, 2024

Now that #1060 merged, we should add some diagnostics to flag when the old style diagnosticFilters pattern looks like a file path instead of a code. This might not be 100% accurate (plugins could do some crazy codes if they wanted to), but it should help almost all the time.

This is going to be a challenge for projects that are trying to migrate from v0 to v1 because their diagnostic filters are no longer compatible.

For example:

{
    "diagnosticFilters": [
         "source/vendor/**/*",
    ]
}

Should be flagged because that is very clearly a glob, and those need to now be in the format:

{
    "diagnosticFilters": [{
        "files": [
            "source/vendor/**/*"
        ]
    }]
}

We could probably flag the following:

  • if there is a ./ or ../
  • if there is a globstar **
  • if there is a .bs or .brs or .xml file extension at the end
@TwitchBronBron TwitchBronBron added this to the v1.0.0 milestone Dec 23, 2024
@TwitchBronBron
Copy link
Member Author

Alternatively, we could add some type of compatibility flag into the bsconfig to help teams migrate. but hopefully when we get closer to a proper v1 release, we won't have many teams hopping between v0 and v1 so often.

something like:
{
"diagnosticFiltersV0Compatibility": true
"diagnosticFilters": [...theOldStyleHere]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant