On Fri, 15 Apr 2022 07:40:04 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

> I ran `codespell` on hotspot, and accepted those changes where it indeed 
> discovered real typos. 
> 
> You'd be surprised over the many implementions of instrinsics and other 
> intructions accross all archtectures I've encounted, so for the preceding 
> reason it's neccesery to sucessfully seach for exisiting typos...

Thank you for all your input! I will update the PR according to all 
suggestions. But let me answer a few more general comments first.

The spelling corrections in this PR was generated by codespell. I manually 
removed all false positives (that was the most tedious part of this fix). 
Codespell works by checking a list of commonly misspelled words, not by 
verifying that all words are present in a list of accepted spellings. The 
latter approach might work for normal prose, but is utterly worthless for 
source code. In practice, codespell does automatically what several users have 
been doing manually lately -- discover a common misspelling, searching the code 
base for more instances of that misspelling. So, there are certainly lots of 
typos left. But this should reasonably cut down on the number of PRs of the 
type "Fix typos for supercalifragilisticexpialidocious" that updates a lot of 
files for just a single misspelled word.

For some cases where I were not sure (like mismatch or re-enable), I googled, 
read spelling recommendations and/or checked how common alternative spellings 
where. When the ratio exceeded 10:1 or so, I deemed one alternative as 
"correct"; in less common cases I let the original authors choice of spelling 
remain.

I have not read the complete sentences, just verified that the actual word 
fixes seemed to make sense. Hence the odd results in some places. 

Ideally, I would like to find some way of keeping the code "codespell clean" 
using tooling. Due to the amount of false positives, this is not a trivial 
task. I don't think we'll ever be able to have it as part of jcheck, but we 
might have a script that someone runs once per release or so. I'm not yet sure 
how to achieve this, but my two main ideas is to either just run codespell on 
added or modified code (think "+" lines in git diff), or to have a list of 
acknowledged false positives that should be skipped.

Before I can even start on this, the huge number of *true* positives needs to 
be addressed, though! Hotspot is by no means worst, it's just a huge chunk of 
code which I addressed all at once.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8260

Reply via email to