lab0-c icon indicating copy to clipboard operation
lab0-c copied to clipboard

`fmtscan` reports unique bad spellings but does not specify where

Open EricccTaiwan opened this issue 9 months ago • 2 comments

When committing , fmtscan reports "3 unique bad spellings found (3 non-unique)" but does not indicate which words are misspelled or their locations in the source code.

It would be helpful if fmtscan can automatically displayed more details about spelling errors.

$ git commit -a
Following files were changed:
  - queue.c : 8 insertions(+), 7 deletions(-)
Running fmtscan...
href
monospace
rel
7804 lines scanned (0.237M bytes)
53 printf style statements being processed
3 unique bad spellings found (3 non-unique)

[!] Check format strings for spelling
$

EricccTaiwan avatar Mar 13 '25 11:03 EricccTaiwan

Better specify when you commit by providing messages generated by tig or git reflog. I can't be sure what is in stashes and local changes. I see that you use printf related functions 53 times and 3 of them went wrong. There is too little information to check the context. BTW, check #279 to see my error, and it's also about fmtscan which is adopted from #274 and closed by Jserv for conventions.

Urbaner3 avatar Mar 19 '25 03:03 Urbaner3

(base) urbaner@urbaner-wtumagic:~/linux2025/lab0-c$ git commit
Following files were changed:
  - dudect/fixture.c : 96 insertions(+), 11 deletions(-)
Running fmtscan...
meas
8119 lines scanned (0.253M bytes)
53 printf style statements being processed
1 unique bad spellings found (1 non-unique)

[!] Check format strings for spelling
(base) urbaner@urbaner-wtumagic:~/linux2025/lab0-c$ git rst --staged dudect/fixture.c
(base) urbaner@urbaner-wtumagic:~/linux2025/lab0-c$ git diff
diff --git a/dudect/fixture.c b/dudect/fixture.c
index fbf4eb4..dab3934 100644
--- a/dudect/fixture.c
+++ b/dudect/fixture.c

I got the report. There is an output message.

Running fmtscan... meas

Search through the git diff records, I found exact the same syntax "meas" in printf. Yes, it's exactly in printf.

+    double number_traces_max_t = tmp->n[0] + tmp->n[1];
     double max_tau = max_t / sqrt(number_traces_max_t);
 
     printf("\033[A\033[2K");
-    printf("measure: %7.2lf M, ", (number_traces_max_t / 1e6));
+    printf("meas: %7.2lf M, ", (number_traces_max_t / 1e6));
     if (number_traces_max_t < ENOUGH_MEASURE) {
         printf("not enough measurements (%.0f still to go).\n",
                ENOUGH_MEASURE - number_traces_max_t);

So I suggest you share your search and see if the output message really works.

Urbaner3 avatar Mar 20 '25 09:03 Urbaner3