Skip to content

fmtscan reports unique bad spellings but does not specify where #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
EricccTaiwan opened this issue Mar 13, 2025 · 2 comments
Open

Comments

@EricccTaiwan
Copy link
Contributor

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
$
@Urbaner3
Copy link

Urbaner3 commented Mar 19, 2025

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
Copy link

(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.

HeatCrab added a commit to HeatCrab/lab0-c that referenced this issue Apr 4, 2025
During web integration for the assignment, fmtscan flagged three
front-end terms - 'href', 'monospace', and 'rel' - as spelling
errors. This echoes a similar issue noted in sysprog21#265. Add these valid
technical terms to the dictionary to prevent false positives,
ensuring accurate code validation. This resolves the false flagging
noted in sysprog21#265 but does not address its call for enhanced error
reporting in fmtscan.

Change-Id: I9012db1c963e20f9cd275e7e15fe45a1c93d0a5f
HeatCrab added a commit to HeatCrab/lab0-c that referenced this issue Apr 7, 2025
While working on web integration for the assignment, fmtscan marked
'href' and 'rel' from HTML, and 'monospace' from CSS, as spelling
errors - a problem also seen in sysprog21#265. Add these valid terms to the
dictionary to avoid false positives and ensure reliable static
analysis. This fixes the flagging issue from sysprog21#265 but leaves its
request for better error details in fmtscan unaddressed.

Change-Id: Ia59908e7ce9bdf4b6c9e0110d5ad061d401cbba1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants