-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
vvet: fix for dir running + new features (track long fns, empty fns and repeated code) #23405
vvet: fix for dir running + new features (track long fns, empty fns and repeated code) #23405
Conversation
Please add tests too in You can modify ( |
Thanks. I just add it. |
const indexexpr_cutoff = 10 | ||
const infixexpr_cutoff = 10 | ||
const selectorexpr_cutoff = 10 | ||
const callexpr_cutoff = 10 | ||
const stringinterliteral_cutoff = 10 | ||
const stringliteral_cutoff = 10 | ||
const ascast_cutoff = 10 | ||
const stringconcat_cutoff = 10 | ||
|
||
// minimum size for string literals | ||
const stringliteral_min_size = 20 | ||
|
||
// long functions cutoff | ||
const long_fns_cutoff = 300 |
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.
These should be customizable.
An easy way for that is with something like:
const indexexpr_cutoff = os.getenv_opt('VVET_INDEXEXPR', '10').int()
The negative is that setting env variables on windows in cmd for one off commands is clumsier.
struct VetAnalyze { | ||
mut: | ||
repeated_expr_cutoff shared map[string]int // repeated code cutoff | ||
repeated_expr shared map[string]map[string]map[string][]token.Pos // repeated exprs in fn scope |
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.
Why is it shared?
Afaik v vet
is not parallel?
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.
Excellent work.
This PR fixes:
This PR implements:
Huly®: V_0.6-21836