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

Refine Diagnostic Filters and adds human-readable diagnostic names #1241

Open
wants to merge 29 commits into
base: release-1.0.0
Choose a base branch
from

Conversation

markwpearce
Copy link
Collaborator

@markwpearce markwpearce commented Jun 28, 2024

Addresses #1060

  • Changes the structure of bsconfig.json "diagnosticFilters" option to look like this:
Array<string | number | { files?: string | Array<string | { src: string } | { dest: string }>; codes?: Array<number | string> }>;

In more detail:

{
"diagnosticFilters": [
    123,   // numbers are applied to diagnostic code or legacyCode against all files
    "some-diagnostic-name", // strings are applied to diagnostic code (or legacyCode) against all files
    { "codes": ["code-1", "code-2"]}, // an object is allowed with a list of codes to applied against all files
    { "files": "some/glob/**" }, // a file list will suppress all diagnostics in matched files
    { "files": "other/glob/**", "codes": ["some-code"]}, //suppress specific codes in matched files
    { "files": [              //files can be an array of globs
            "other/glob/**",
            "other2/glob/**"
       ],
       "codes": ["some-code"]
    },
    { "files": [{ "src": "yet/another/glob/**"}] }, //file listings in an array can be a object that references src path
    { "files": [{ "dest": "yet/another/glob/**"}] } //file listings in an array can be a object that references dest path
]}

Additionally, I went through all the diagnostics and assigned a human-readable code property to them, which can also be used for any diagnostic filtering. The previous (numerical) code property was renamed to legacyCode

@markwpearce markwpearce added this to the v1.0.0 milestone Jun 28, 2024
@markwpearce markwpearce changed the base branch from master to release-1.0.0 June 28, 2024 13:51
@markwpearce
Copy link
Collaborator Author

@josephjunker Please take a look at this PR -- you did a lot of work on DiagnosticFiltering and I hope that's respected here.

@josephjunker
Copy link
Collaborator

@markwpearce Looks good to me!

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did an initial pass of this and have some suggestions. I still need to go through every diagnostic code and tweak their names, that'll come later.

docs/bsconfig.md Outdated Show resolved Hide resolved
docs/bsconfig.md Outdated Show resolved Hide resolved
docs/bsconfig.md Outdated Show resolved Hide resolved
docs/bsconfig.md Outdated Show resolved Hide resolved
docs/bsconfig.md Outdated Show resolved Hide resolved
docs/bsconfig.md Outdated Show resolved Hide resolved
src/DiagnosticMessages.spec.ts Show resolved Hide resolved
markwpearce and others added 3 commits July 12, 2024 14:12
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've only made it through diagnostic code 1063. Figure I'll submit what I have awhile, and keep working.

src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Show resolved Hide resolved
src/DiagnosticMessages.ts Show resolved Hide resolved
src/DiagnosticMessages.ts Show resolved Hide resolved
markwpearce and others added 5 commits July 20, 2024 09:25
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Co-authored-by: Bronley Plumb <bronley@gmail.com>
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some more name tweaks.

src/DiagnosticMessages.ts Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
src/DiagnosticMessages.ts Outdated Show resolved Hide resolved
@TwitchBronBron TwitchBronBron deleted the branch release-1.0.0 September 25, 2024 15:06
@TwitchBronBron TwitchBronBron reopened this Oct 1, 2024
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

Successfully merging this pull request may close these issues.

3 participants