Use a factory to create diagnostics so that error-level diagnostics are always ErrorDiagnostics
Open
tech debt
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
Out of scope of this PR, but should we implement some sort of factory pattern to prevent us from ever creating `Diagnostic` with level set to error?
_Originally posted by @majastrz in https://github.com/Azure/bicep/pull/8899#discussion_r1014407011_
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating the construction sites for Diagnostic and ErrorDiagnostics, then determine how the proposed factory would enforce the error-level invariant; done means error-level diagnostics are consistently represented as ErrorDiagnostics and the behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100