Azure / Azure/bicep

Use a factory to create diagnostics so that error-level diagnostics are always ErrorDiagnostics

Open
#8,901 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.