mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Fix: vet false warning on brackets in documentation (#17767)
This commit is contained in:
parent
db97630117
commit
713c95fcc8
@ -0,0 +1,9 @@
|
||||
|
||||
// normalize_vector Normalizes a vector
|
||||
//
|
||||
// Example:
|
||||
// ```v
|
||||
// vector := Vector{3, 4}
|
||||
// normalize_vector(vector) // Vector{0.6, 0.8}
|
||||
// ```
|
||||
pub fn normalize_vector(vector f32) {}
|
@ -187,9 +187,9 @@ fn (mut vt Vet) vet_fn_documentation(lines []string, line string, lnumber int) {
|
||||
prev_prev_line = lines[j - 1]
|
||||
}
|
||||
prev_line := lines[j]
|
||||
if prev_line.contains('}') { // We've looked back to the above scope, stop here
|
||||
break
|
||||
} else if prev_line.starts_with('// ${fn_name} ') {
|
||||
|
||||
if prev_line.starts_with('//') {
|
||||
if prev_line.starts_with('// ${fn_name} ') {
|
||||
grab = false
|
||||
break
|
||||
} else if prev_line.starts_with('// ${fn_name}')
|
||||
@ -199,11 +199,16 @@ fn (mut vt Vet) vet_fn_documentation(lines []string, line string, lnumber int) {
|
||||
vt.warn('The documentation for "${clean_line}" seems incomplete.',
|
||||
lnumber, .doc)
|
||||
break
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if prev_line.contains('}') { // We've looked back to the above scope, stop here
|
||||
break
|
||||
} else if prev_line.starts_with('[') {
|
||||
tags << collect_tags(prev_line)
|
||||
continue
|
||||
} else if prev_line.starts_with('//') { // Single-line comment
|
||||
continue
|
||||
}
|
||||
}
|
||||
if grab {
|
||||
|
Loading…
Reference in New Issue
Block a user