-
Notifications
You must be signed in to change notification settings - Fork 121
Add lint groups to Q# #2103
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
base: main
Are you sure you want to change the base?
Add lint groups to Q# #2103
Conversation
Should we update our qsharp.json schema? ( vscode\qsharp.schema.json ) |
/// End-user configuration for a specific lint or a lint group. | ||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] | ||
#[serde(untagged)] | ||
pub enum LintOrGroupConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since level
is a common field, I probably would have organized the types like this - fewer structs. It doesn't make a meaningful difference at runtime, and it might make deserialization awkward I don't know. So take it or leave it - I just wanted to make sure you considered it
struct LintConfig {
kind: LintConfigKind,
level: LintLevel,
}
enum LintConfigKind {
Lint(LintKind),
Group(LintGroup)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I just saw unfold_group
above - my suggestion would probably make that function more awkward. So I can see why you did it this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add copyright header
This PR adds the necessary infrastructure to define lint groups. It also adds the
deprecation
lint group, which allows the user to enable all deprecation lints at the same time, which are set toallow
by default.A lint group can be added to the
qsharp.json
manifest as follows: