[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABJPP5BExfW+xre-3E-9EysYMhLGRzNrkPbTW3qomOKqc31PSQ@mail.gmail.com>
Date: Sun, 9 May 2021 21:12:22 +0530
From: Dwaipayan Ray <dwaipayanray1@...il.com>
To: Joe Perches <joe@...ches.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Codespell dictionary path is no longer absolute
A year ago, the codespell dictionary was moved from
/usr/share/codespell/dictionary.txt to data/dictionary.txt under
the codespell_lib installation directory.
checkpatch.pl still has the default codespell path as
/usr/share/codespell/dictionary.txt.
Any new installations will now also need to specify --codespellfile
option along with --codespell.
Can auto detection of the dictionary path be enabled with something
like this?
-----
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 23697a6b1eaa..28ca5cfff2d5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -889,6 +889,9 @@ if (open(my $spelling, '<', $spelling_file)) {
}
if ($codespell) {
+ if (! -e "$codespellfile" && which("python") ne "") {
+ $codespellfile = `python -c "import os.path as op; import code
spell_lib; print(op.join(op.dirname(codespell_lib.__file__), 'data', 'dictiona
ry.txt'), end='')"`;
+ }
if (open(my $spelling, '<', $codespellfile)) {
while (<$spelling>) {
my $line = $_;
-----
Thanks,
Dwaipayan.
Powered by blists - more mailing lists