Skip to content

Commit

Permalink
renamed lint to DiscourageChainAssignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottCarda-MS committed Dec 16, 2024
1 parent 0c2c5af commit 23b1ca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compiler/qsc_linter/src/lints/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare_ast_lints! {
(RedundantSemicolons, LintLevel::Warn, "redundant semicolons", "remove the redundant semicolons"),
(DeprecatedNewtype, LintLevel::Allow, "deprecated `newtype` declarations", "`newtype` declarations are deprecated, use `struct` instead"),
(DeprecatedSet, LintLevel::Allow, "deprecated use of `set` keyword", "the `set` keyword is deprecated for assignments and can be removed"),
(DiscourageDaisyChain, LintLevel::Warn, "discouraged use of chain assignment", "assignment expressions always return `Unit`, so chaining them may not be useful"),
(DiscourageChainAssignment, LintLevel::Warn, "discouraged use of chain assignment", "assignment expressions always return `Unit`, so chaining them may not be useful"),
}

#[derive(Default)]
Expand Down Expand Up @@ -226,13 +226,13 @@ impl AstLintPass for DeprecatedSet {
}

#[derive(Default)]
struct DiscourageDaisyChain {
struct DiscourageChainAssignment {
level: LintLevel,
// Keeps track of the expressions that won't create lints because they are part of a chain.
repressed_exprs: Vec<NodeId>,
}

impl AstLintPass for DiscourageDaisyChain {
impl AstLintPass for DiscourageChainAssignment {
fn check_expr(&mut self, expr: &Expr, buffer: &mut Vec<Lint>, _compilation: Compilation) {
match expr.kind.as_ref() {
ExprKind::Assign(_, rhs)
Expand Down
2 changes: 1 addition & 1 deletion vscode/qsharp.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"redundantSemicolons",
"deprecatedNewtype",
"deprecatedSet",
"discourageDaisyChain",
"discourageChainAssignment",
"needlessOperation",
"deprecatedFunctionConstructor",
"deprecatedWithOperator",
Expand Down

0 comments on commit 23b1ca6

Please sign in to comment.