mirror of
https://github.com/curl/curl.git
synced 2026-08-26 11:33:34 +03:00
GHA/checksrc: expand spellcheck, fix issues found
- codespell: break logic out into its own runnable script. Allowing to run it on local machines. - codespell: install via `pip`, bump to latest version. - codespell: show version number in CI log. - codespell: drop no longer needed word exception: `msdos`. - codespell: include all curl source tree, except `packages` and `winbuild`. Drop an obsolete file exclusion. - add new spellchecker job using the `typos` tool. It includes the codespell dictionary and a couple more. Use linuxbrew to install it. This takes 10 seconds, while installing via `cargo` from source would take over a minute. - codespell: introduce an inline ignore filter compatible with `cspell` Make `typos` recognize it, too. Move single exceptions inline. Fix new typos found. Also rename variables and words to keep spellchecking exceptions at minumum. This involves touching some tests. Also switch base64 strings to `%b64[]` to avoid false positives. Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md Ref: https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore Ref: https://github.com/codespell-project/codespell/issues/1212#issuecomment-1721152455 Ref: https://cspell.org/docs/Configuration/document-settings Closes #17905
This commit is contained in:
parent
792a61e204
commit
0260e8465a
81 changed files with 279 additions and 206 deletions
|
|
@ -244,11 +244,11 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
const char *main, const char *sub, FILE *stream)
|
||||
{
|
||||
# define MAX_TAG_LEN 200
|
||||
char couter[MAX_TAG_LEN + 1]; /* current outermost section */
|
||||
char cmain[MAX_TAG_LEN + 1]; /* current main section */
|
||||
char csub[MAX_TAG_LEN + 1]; /* current sub section */
|
||||
char ptag[MAX_TAG_LEN + 1]; /* potential tag */
|
||||
char patt[MAX_TAG_LEN + 1]; /* potential attributes */
|
||||
char curouter[MAX_TAG_LEN + 1]; /* current outermost section */
|
||||
char curmain[MAX_TAG_LEN + 1]; /* current main section */
|
||||
char cursub[MAX_TAG_LEN + 1]; /* current sub section */
|
||||
char ptag[MAX_TAG_LEN + 1]; /* potential tag */
|
||||
char patt[MAX_TAG_LEN + 1]; /* potential attributes */
|
||||
char *buffer = NULL;
|
||||
char *ptr;
|
||||
char *end;
|
||||
|
|
@ -278,7 +278,7 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
return GPE_OUT_OF_MEMORY;
|
||||
*(*outbuf) = '\0';
|
||||
|
||||
couter[0] = cmain[0] = csub[0] = ptag[0] = patt[0] = '\0';
|
||||
curouter[0] = curmain[0] = cursub[0] = ptag[0] = patt[0] = '\0';
|
||||
|
||||
while((error = readline(&buffer, &bufsize, &datalen, stream)) == GPE_OK) {
|
||||
|
||||
|
|
@ -314,10 +314,10 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
memcpy(ptag, ptr, len.uns);
|
||||
ptag[len.uns] = '\0';
|
||||
|
||||
if((STATE_INSUB == state) && !strcmp(csub, ptag)) {
|
||||
if((STATE_INSUB == state) && !strcmp(cursub, ptag)) {
|
||||
/* end of current sub section */
|
||||
state = STATE_INMAIN;
|
||||
csub[0] = '\0';
|
||||
cursub[0] = '\0';
|
||||
if(in_wanted_part) {
|
||||
/* Do we need to base64 decode the data? */
|
||||
if(base64) {
|
||||
|
|
@ -330,10 +330,10 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if((STATE_INMAIN == state) && !strcmp(cmain, ptag)) {
|
||||
else if((STATE_INMAIN == state) && !strcmp(curmain, ptag)) {
|
||||
/* end of current main section */
|
||||
state = STATE_OUTER;
|
||||
cmain[0] = '\0';
|
||||
curmain[0] = '\0';
|
||||
if(in_wanted_part) {
|
||||
/* Do we need to base64 decode the data? */
|
||||
if(base64) {
|
||||
|
|
@ -346,10 +346,10 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if((STATE_OUTER == state) && !strcmp(couter, ptag)) {
|
||||
else if((STATE_OUTER == state) && !strcmp(curouter, ptag)) {
|
||||
/* end of outermost file section */
|
||||
state = STATE_OUTSIDE;
|
||||
couter[0] = '\0';
|
||||
curouter[0] = '\0';
|
||||
if(in_wanted_part)
|
||||
break;
|
||||
}
|
||||
|
|
@ -393,21 +393,21 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
|
||||
if(STATE_OUTSIDE == state) {
|
||||
/* outermost element (<testcase>) */
|
||||
strcpy(couter, ptag);
|
||||
strcpy(curouter, ptag);
|
||||
state = STATE_OUTER;
|
||||
continue;
|
||||
}
|
||||
else if(STATE_OUTER == state) {
|
||||
/* start of a main section */
|
||||
strcpy(cmain, ptag);
|
||||
strcpy(curmain, ptag);
|
||||
state = STATE_INMAIN;
|
||||
continue;
|
||||
}
|
||||
else if(STATE_INMAIN == state) {
|
||||
/* start of a sub section */
|
||||
strcpy(csub, ptag);
|
||||
strcpy(cursub, ptag);
|
||||
state = STATE_INSUB;
|
||||
if(!strcmp(cmain, main) && !strcmp(csub, sub)) {
|
||||
if(!strcmp(curmain, main) && !strcmp(cursub, sub)) {
|
||||
/* start of wanted part */
|
||||
in_wanted_part = 1;
|
||||
if(strstr(patt, "base64="))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue