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

fmt: smarter if condition wrapping (#8201)

This commit is contained in:
Lukas Neubert
2021-01-23 09:33:22 +01:00
committed by GitHub
parent 9812230847
commit 8b61891348
65 changed files with 686 additions and 811 deletions

View File

@@ -159,9 +159,8 @@ fn (mut vt Vet) vet_file(path string, is_regression_test bool) {
// vet_line vets the contents of `line` from `vet.file`.
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')))
{
if line.starts_with('pub fn') || (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 {