Repository navigation
Conversation
|
Change this to work on the v1 branch |
434bd63 to
78246b6
Compare
78246b6 to
de8e9e3
Compare
|
@markwpearce Done — this branch has been rebased onto |
markwpearce
left a comment
There was a problem hiding this comment.
If we're truly working with a Threshold, then I would assume we can just specify one limit (eg. just severity)?
I think that logically, if I were to add a severity limit, I'd want to say the limit, not the ones not included in the limit.
So, for example:
{
"files": "components/**/*",
"severity": "warn"
}
would filter OUT any "hint" or "Info" diagnostics from components
I think the way the code is written now, that filter would allow hints, info and errors, BUT not warnings?
To be more clear about what the change means, perhaps you could change it to "minSeverity" or something?
eg.
{
"files": "components/**/*",
"minSeverity": "warn"
}
|
Thanks for the feedback @markwpearce! That makes much more sense as a threshold. I have updated the PR in
|
markwpearce
left a comment
There was a problem hiding this comment.
Just a few changes and a suggested test
|
Thanks for the review! I have updated the PR in
|
Fixes #776
Summary
Adds support for filtering diagnostics by a minimum severity threshold (
minSeverity) indiagnosticFilters:src/BsConfig.ts,bsconfig.schema.json): AddsminSeverity?: BsDiagnosticSeverity('error' | 'warn' | 'info' | 'hint' | DiagnosticSeverity) todiagnosticFiltersfilter objects.src/DiagnosticFilterer.ts):minSeverityin global ({ minSeverity: 'warn' }),files-scoped ({ files: 'components/**/*', minSeverity: 'warn' }),dest-scoped, and v0-compatibility filter objects.minSeverity(e.g.minSeverity: 'warn'filters out'info'and'hint'diagnostics while keeping'warn'and'error').codesandminSeverityon the same filter object (logical AND), as well as negative globs (!pattern) to un-ignore diagnostics meetingminSeverity.isFileCompletelyFiltered()returnsfalsewhenminSeverityis specified so file validation is not skipped.src/DiagnosticManager.ts): RunsdiagnosticAdjuster.adjust()beforefilterDiagnostics()sodiagnosticSeverityOverridesare respected when filtering byminSeverity.docs/bsconfig.md,src/DiagnosticFilterer.spec.ts): DocumentsminSeverityindiagnosticFiltersand adds unit tests covering threshold filtering.