-
Notifications
You must be signed in to change notification settings - Fork 303
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
scripts: checkpatch: get codespell dictionary path from package location #4855
Conversation
Can you submit this upstream first? |
For some reason this PR breaks... our checkpatch in Github!
Whereas in this other, unrelated PR the dictionary is found:
Thanks to its stupidity, we can see codespell ran in that other PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not upstream, breaks checkpatch in CI
I think it complains about the long line in the commit mesaage, which ironically reads: I'll push a new test commit with short lines to see... |
That sounds right (and very funny). Sorry for the confusion. Still: this should be at least submitted (if not merged) upstream first. Workarounds on my system:
Also:
|
d98bc19
to
267def6
Compare
Changes since v1:
|
CI looks good now, @marc-hb do we need any CI updates prior to merge or are we good to go ? |
let's wait for my upstream version, it is getting into shape |
No any change takes effect immediately. |
Sorry, now I understand your question. @ujfalusi at your leisure please add to this PR a second commit with this change: --- a/.github/workflows/codestyle.yml
+++ b/.github/workflows/codestyle.yml
@@ -21,8 +21,7 @@ jobs:
PR_NUM: ${{github.event.number}}
# TODO: reduce duplication with scripts/sof-*-commit-hook.sh
# thanks to either some .conf file or some wrapper script
- CHK_CMD_OPTS: --ignore UNKNOWN_COMMIT_ID --codespell --codespellfile
- /usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt
+ CHK_CMD_OPTS: --ignore UNKNOWN_COMMIT_ID --codespell
--ignore C99_COMMENT_TOLERANCE
steps:
# depth 2 so: This second commit will test your first one. |
OK, I'll try to remember ;)
if the codespell installation is correct it will. |
The codespell installation is performed 5 lines below. It's performed with the highly unusual and ground-breaking I recommend having a look at the file, it's 55 lines long including whitespace and comments. |
Yes, I have checked already.
Could result in
all while
Just a heads up. |
I don't understand. I checked on both Ubuntu and Fedora and in both the python library and the dictionary are part of the same package. This package comes from the single https://github.com/codespell-project/codespell/ project. Some other Linux distributions like to make their life difficult? |
Looks like v7 is likely going to make it to mainline: |
267def6
to
1e03d2f
Compare
Changes since v2:
|
Looks good except for this: https://lore.kernel.org/all/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com/T/#u
|
Right, I have notified Andrew Morton and Joe Perches about the wrong link in the applied patch. all contains the same wrong link. |
@ujfalusi is this PR pending on external fixes now before merge ? |
I'm not sure if there will be a fix for the |
|
Aargh, github UI made me close the PR. We can wait a day or two, but I don't think there is going to be a fix for it. |
So IIUC, this is a tmp fix whist this is being fixed upstream. Any reason now not to merge ? |
we should have something to make sure we revert and reland once fixed upstream so it is not forgotten |
@lgirdwood, @cujomalainey, I'm fine waiting a bit more but to be honest I don't think that the The patch is in linux-next: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/scripts/checkpatch.pl We can set the deadline for merge to next Monday? |
@ujfalusi ok, pls remind me on Monday and we can merge if upstream fix is forgotten. I would also recommend a comment as a reminder as @cujomalainey states. |
The standard location of dictionary.txt is under codespell's package, on my machine atm (codespell 2.1, Artix Linux): /usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt Since we enable the codespell by default for SOF I have constant: No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory The patch proposes to try to fix up the path following the recommendation found here: codespell-project/codespell#1540 Mainline commit: 0ee3e7b8893e ("checkpatch: get default codespell dictionary path from package location") Link: https://lkml.kernel.org/r/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
With the backported patch to checkpatch.pl the dictionary.txt location should automagically found and no need to specify it by hand. Suggested-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1e03d2f
to
d3b4698
Compare
Changes since v3:
Note: we have a warning from checkpatch because of unwrapped commit description on the backported patch:
|
@marc-hb, @lgirdwood, @cujomalainey, backported the patch from mainline Linux: |
The standard location of dictionary.txt is under codespell's package, on
my machine atm (codespell 2.1, Artix Linux):
/usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt
Since we enable the codespell by default for SOF I have constant:
No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory
The patch proposes to try to fix up the path following the recommendation
found here:
codespell-project/codespell#1540
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com