checksrc: disallow spaces before labels

Out of 415 labels throughout the code base, 86 of those labels were
not at the start of the line. Which means labels always at the start of
the line is the favoured style overall with 329 instances.

Out of the 86 labels not at the start of the line:
* 75 were indented with the same indentation level of the following line
* 8 were indented with exactly one space
* 2 were indented with one fewer indentation level then the following
  line
* 1 was indented with the indentation level of the following line minus
  three space (probably unintentional)

Co-Authored-By: Viktor Szakats

Closes #11134
This commit is contained in:
Emanuele Torre 2023-05-18 06:54:18 +02:00 committed by Daniel Stenberg
parent d334b02924
commit f198d33e8d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
55 changed files with 92 additions and 86 deletions

View file

@ -900,7 +900,7 @@ int formparse(struct OperationConfig *config,
goto fail;
}
err = 0;
fail:
fail:
Curl_safefree(contents);
curl_slist_free_all(headers);
return err;

View file

@ -624,7 +624,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
return CURLE_OK;
}
} /* if retry_numretries */
noretry:
noretry:
if((global->progressmode == CURL_PROGRESS_BAR) &&
per->progressbar.calls)

View file

@ -170,7 +170,7 @@ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename)
/* nothing to do */
result = CURLE_OK;
}
fail:
fail:
curl_url_cleanup(uh);
curl_free(path);
return result;

View file

@ -296,7 +296,7 @@ CURLcode tool_setopt_enum(CURL *curl, struct GlobalConfig *config,
if(ret)
warnf(config, "option %s returned error (%d)\n", name, (int)ret);
#endif
nomem:
nomem:
return ret;
}
@ -338,7 +338,7 @@ CURLcode tool_setopt_flags(CURL *curl, struct GlobalConfig *config,
CODE2("%s%ldL);", preamble, rest);
}
nomem:
nomem:
return ret;
}
@ -381,7 +381,7 @@ CURLcode tool_setopt_bitmask(CURL *curl, struct GlobalConfig *config,
CODE2("%s%luUL);", preamble, rest);
}
nomem:
nomem:
return ret;
}
@ -407,7 +407,7 @@ static CURLcode libcurl_generate_slist(struct curl_slist *slist, int *slistno)
*slistno, *slistno, escaped);
}
nomem:
nomem:
Curl_safefree(escaped);
return ret;
}
@ -590,7 +590,7 @@ CURLcode tool_setopt_slist(CURL *curl, struct GlobalConfig *config,
CODE2("curl_easy_setopt(hnd, %s, slist%d);", name, i);
}
nomem:
nomem:
return ret;
}
@ -704,7 +704,7 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *global,
}
}
nomem:
nomem:
Curl_safefree(escaped);
return ret;
}

View file

@ -295,7 +295,7 @@ static CURLcode glob_range(struct URLGlob *glob, char **patternp,
}
}
fail:
fail:
*posp += (pattern - *patternp);
if(!endp || !step_n ||

View file

@ -75,7 +75,7 @@ char *stripcredentials(const char *url)
return nurl;
}
error:
error:
curl_url_cleanup(u);
return NULL;
}