1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: fix if cond break readability (#8132)

This commit is contained in:
Daniel Däschle
2021-01-16 02:12:17 +01:00
committed by GitHub
parent 2f7a66386e
commit 53941c4a0a
29 changed files with 272 additions and 133 deletions

View File

@@ -160,7 +160,8 @@ fn (mut vt Vet) vet_file(path string, is_regression_test bool) {
fn (mut vet Vet) vet_line(lines []string, line string, lnumber int) {
// Vet public functions
if line.starts_with('pub fn') ||
(line.starts_with('fn ') && !(line.starts_with('fn C.') || line.starts_with('fn main'))) {
(line.starts_with('fn ') && !(line.starts_with('fn C.') || line.starts_with('fn main')))
{
// Scan function declarations for missing documentation
is_pub_fn := line.starts_with('pub fn')
if lnumber > 0 {