[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: Add a method of automatically sorting the spelling files



This is an automated email from the git hooks/post-receive script.

jwilk pushed a commit to branch master
in repository lintian.

commit e55f0d07e8fd47396ae6a8c1b01becfcfc224521
Author: Paul Wise <pabs@debian.org>
Date:   Wed Sep 7 18:59:38 2016 +0800

    Add a method of automatically sorting the spelling files
    
    Use csplit to prevent sorting the header.
    Use sort -u to eliminate duplicates.
    Use LC_ALL to set the right sort order.
---
 data/spelling/Makefile              | 6 ++++++
 data/spelling/corrections           | 2 +-
 data/spelling/corrections-case      | 2 +-
 data/spelling/corrections-multiword | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/data/spelling/Makefile b/data/spelling/Makefile
new file mode 100644
index 0000000..4554dfc
--- /dev/null
+++ b/data/spelling/Makefile
@@ -0,0 +1,6 @@
+sort: sort-corrections sort-corrections-case sort-corrections-multiword
+
+sort-%: %
+	csplit --prefix $<- $< '/^$$/'
+	LC_ALL=en_US sort -u $<-01 | cat $<-00 - > $<
+	rm -f $<-0[01]
diff --git a/data/spelling/corrections b/data/spelling/corrections
index 0e15ef7..a1516f3 100644
--- a/data/spelling/corrections
+++ b/data/spelling/corrections
@@ -15,7 +15,7 @@
 # Note that corrections involving multiple word mistakes or case errors
 # should be included in the appropriate data file, rather than here.
 #
-# Please keep the list sorted (using the en_US locale).
+# Please keep the list sorted using `make sort`
 
 abailable||available
 abandonned||abandoned
diff --git a/data/spelling/corrections-case b/data/spelling/corrections-case
index 99d8f18..e874cce 100644
--- a/data/spelling/corrections-case
+++ b/data/spelling/corrections-case
@@ -6,7 +6,7 @@
 # The format of each line is:
 # mistake||correction
 #
-# Please keep the list sorted (using the en_US locale).
+# Please keep the list sorted using `make sort`
 
 american||American
 apache||Apache
diff --git a/data/spelling/corrections-multiword b/data/spelling/corrections-multiword
index cae8c06..559bbe1 100644
--- a/data/spelling/corrections-multiword
+++ b/data/spelling/corrections-multiword
@@ -5,7 +5,7 @@
 # The format of each line is:
 # SPELLING_MISTAKE_REGEX||correction
 #
-# Please keep the list sorted (using the en_US locale).
+# Please keep the list sorted using `make sort`
 
 (?i)allows to||allows one to
 (?i)allow to||allow one to

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: