On 7/7/25 8:43 PM, Aaron Conole wrote:
> Checkpatch contains a large list of spelling words, currently 326. The
> in-built list is quite cumbersome, and includes duplicate entries
> ('netdev' and 'revalidation'). Managing this list will continue to grow
> difficult over time, and really shouldn't be so difficult. To make the
> maintenance of OVS specific spelling words easier, create a new file
> that will contain the spelling words and move the list into that file
> (sorted). Additionally, add 'FreeBSD' and 'gcloud' to the list as I
> tested against 80d723736b64 ("cirrus: Update to FreeBSD 14.3 and 13.5.")
Maybe worth mentioning also the words from the Eelco's patch?
>
> Signed-off-by: Aaron Conole <[email protected]>
> ---
> v2->v3: - Fix the 'uuid validate' line
> - Incorporate Eelco's HW offload word list
> - Rename the wordlist and move it to 'utilities'
> - Introduce a spellcheck test case
>
> tests/checkpatch.at | 37 ++++
> utilities/automake.mk | 1 +
> utilities/checkpatch.py | 73 +-------
> utilities/checkpatch_dict.txt | 330 ++++++++++++++++++++++++++++++++++
> 4 files changed, 374 insertions(+), 67 deletions(-)
> create mode 100644 utilities/checkpatch_dict.txt
>
> diff --git a/tests/checkpatch.at b/tests/checkpatch.at
> index 3182ca8808..2728eaca68 100755
> --- a/tests/checkpatch.at
> +++ b/tests/checkpatch.at
> @@ -726,3 +726,40 @@ try_checkpatch_c_file \
> "
> done
> AT_CLEANUP
> +
> +AT_SETUP([checkpatch - spelling checks])
> +AT_SKIP_IF([! $PYTHON3 -c 'import enchant' >/dev/null 2>&1])
> +
> +dnl First check with some default words
Period at the end of a sentence.
> +
> +try_checkpatch_c_file \
> + "#include <foo.h>
> + #include <bar.h>
> +
> + /* naintenance mode */
> + void foo() {
> + $ctr ( first_run ) {
> + something(check_node);
> + }
> + }" \
> + "WARNING: Possible misspelled word: \"naintenance\"
> +Did you mean: [['maintenance', 'countenance', 'centenarian']]
This part seems a little problematic. As we do not control the content
of the default dictionaries enchant is using, the list of suggestions
here can change depending on the version. And that will result in test
failures. Can we cut the exact suggestions or the whole line out of
the test?
> @@ -132,8 +67,12 @@ def open_spell_check_dict():
> for word in words:
> spell_check_dict.add_to_session(word.strip())
>
> - for kw in extra_keywords:
> - spell_check_dict.add_to_session(kw)
> + sw_file = os.path.join(get_top_directory(), "utilities",
> + "checkpatch_dict.txt")
> + if os.path.exists(sw_file):
> + with open(sw_file, "r") as spelling_words:
> + for sw in spelling_words:
> + spell_check_dict.add_to_session(sw.strip())
Should we rename some of these variables since we renamed the file?
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev