Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 8, 2025
1 parent ca394dc commit 2ed146e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
20 changes: 10 additions & 10 deletions cmd/tools/vvet/analysis.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ mut:
fn (mut vt Vet) repeated_code(expr ast.Expr) {
match expr {
ast.IndexExpr {
lock vt.analysis.repeated {
vt.analysis.repeated['${expr.left}[${expr.index}]'][vt.file] << expr.pos
}
// lock vt.analysis.repeated {
// vt.analysis.repeated['${expr.left}[${expr.index}]'][vt.file] << expr.pos
// }
}
ast.CallExpr {
lock vt.analysis.repeated {
if expr.is_static_method || expr.is_method {
vt.analysis.repeated['${expr.left}.${expr.name}(${expr.args.map(it.str()).join(', ')})'][vt.file] << expr.pos
} else {
vt.analysis.repeated['${expr.mod}.${expr.name}(${expr.args.map(it.str()).join(', ')})'][vt.file] << expr.pos
}
}
// lock vt.analysis.repeated {
// if expr.is_static_method || expr.is_method {
// vt.analysis.repeated['${expr.left}.${expr.name}(${expr.args.map(it.str()).join(', ')})'][vt.file] << expr.pos
// } else {
// vt.analysis.repeated['${expr.mod}.${expr.name}(${expr.args.map(it.str()).join(', ')})'][vt.file] << expr.pos
// }
// }
}
else {}
}
Expand Down
12 changes: 0 additions & 12 deletions cmd/tools/vvet/errors.v
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,3 @@ fn (vt &Vet) e2string(err VetError) string {
}
return '${location} ${kind} ${err.message}'
}

fn (vt &Vet) report(err_kind ErrorKind, message string) string {
mut kind := '${err_kind}:'
if vt.opt.use_color {
kind = term.bold(match err_kind {
.warning { term.magenta(kind) }
.error { term.red(kind) }
.notice { term.yellow(kind) }
})
}
return '${kind} ${message}'
}

0 comments on commit 2ed146e

Please sign in to comment.