-
Notifications
You must be signed in to change notification settings - Fork 130
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
Merged
Merged
Add lint groups to Q# #2103
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0970222
pipe group configuration from json to rust linter
orpuente-MS d27e8f0
add lint groups
orpuente-MS dba7b62
update unit test
orpuente-MS 8c1fb07
Merge branch 'main' into oscarpuente/lint-groups
orpuente-MS 6a73b8d
change Pedantic to Deprecation
orpuente-MS 96ceb76
format file
orpuente-MS 2345beb
rename `Deprecation` to `Deprecations`
orpuente-MS b3adc6e
update qsharp.schema.json
orpuente-MS 4820147
update json schema
orpuente-MS d7781ba
fix clippy lint
orpuente-MS 6eb99dd
add license header
orpuente-MS 9703285
format file
orpuente-MS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
use crate::{LintKind, LintLevel}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// End-user configuration for a lint group. | ||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] | ||
pub struct GroupConfig { | ||
#[serde(rename = "group")] | ||
/// The lint group. | ||
pub lint_group: LintGroup, | ||
/// The group level. | ||
pub level: LintLevel, | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum LintGroup { | ||
Deprecations, | ||
orpuente-MS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
impl LintGroup { | ||
pub fn unfold(self) -> Vec<LintKind> { | ||
use crate::AstLint::*; | ||
use crate::HirLint::*; | ||
match self { | ||
LintGroup::Deprecations => { | ||
vec![ | ||
LintKind::Ast(DeprecatedNewtype), | ||
LintKind::Ast(DeprecatedSet), | ||
LintKind::Hir(DeprecatedFunctionConstructor), | ||
LintKind::Hir(DeprecatedWithOperator), | ||
LintKind::Hir(DeprecatedDoubleColonOperator), | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.