Skip to content
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

checkpatch: fix TYPO_SPELLING check for words with apostrophe #484

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

arnopo
Copy link
Collaborator

@arnopo arnopo commented Apr 16, 2023

Fix issue #483

A false positive is "doesn't".  Occurrence of the word causes checkpatch
to emit the following warning:

"WARNING: 'doesn'' may be misspelled - perhaps 'doesn't'?"

The PR is a cherry pick of from Linux kernel:
https://lore.kernel.org/all/[email protected]/T/#u

checkpatch reports a false TYPO_SPELLING warning for some words containing
an apostrophe when run with --codespell option.

A false positive is "doesn't".  Occurrence of the word causes checkpatch
to emit the following warning:

"WARNING: 'doesn'' may be misspelled - perhaps 'doesn't'?"

Modify the regex pattern to be more in line with the codespell default
word matching regex.  This fixes the word capture and avoids the false
warning.

In addition, highlight the misspelled word location by adding a caret
below the word.

Signed-off-by: Dwaipayan Ray <[email protected]>
Suggested-by: Joe Perches <[email protected]>
Reported-by: Peilin Ye <[email protected]>
Signed-off-by: Arnaud Pouliquen <[email protected]>
@arnopo arnopo linked an issue Apr 16, 2023 that may be closed by this pull request
@arnopo arnopo requested a review from edmooring April 16, 2023 13:43
@arnopo
Copy link
Collaborator Author

arnopo commented Apr 16, 2023

@tammyleino : I tested it on your PR #478 with following commands:

 wget https://github.com/OpenAMP/open-amp/pull/478.patch
 ./scripts/checkpatch.pl --codespell 478.patch

That fixes the false positive

@arnopo arnopo merged commit 7106b67 into OpenAMP:main Apr 20, 2023
@arnopo arnopo added this to the Release V2023.04 milestone Apr 20, 2023
@arnopo arnopo deleted the checkpatch branch July 10, 2023 09:16
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

Successfully merging this pull request may close these issues.

[checkpatch] false positive on words with apostrophe
2 participants