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
naintenance 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.")

Signed-off-by: Aaron Conole <acon...@redhat.com>
---
v1->v2:
   * Add the spelling words file to extra_dist
   * Fix the line length of the commit message

 build-aux/automake.mk        |   1 +
 build-aux/spelling_words.txt | 326 +++++++++++++++++++++++++++++++++++
 utilities/checkpatch.py      |  73 +-------
 3 files changed, 333 insertions(+), 67 deletions(-)
 create mode 100644 build-aux/spelling_words.txt

diff --git a/build-aux/automake.mk b/build-aux/automake.mk
index d65b6da6c5..45a5a8f648 100644
--- a/build-aux/automake.mk
+++ b/build-aux/automake.mk
@@ -17,6 +17,7 @@ EXTRA_DIST += \
        build-aux/initial-tab-allowed-files \
        build-aux/sodepends.py \
        build-aux/soexpand.py \
+       build-aux/spelling_words.txt \
        build-aux/text2c \
        build-aux/xml2nroff
 
diff --git a/build-aux/spelling_words.txt b/build-aux/spelling_words.txt
new file mode 100644
index 0000000000..7643220108
--- /dev/null
+++ b/build-aux/spelling_words.txt
@@ -0,0 +1,326 @@
+acl
+addresssanitizer
+afxdp
+alg
+alloc
+amd64
+api
+appctl
+appveyor
+arg
+arp
+asan
+attr
+backport
+backtrace
+bfd
+bitmask
+bool
+cacheline
+cgtime
+char
+checkpatch
+checksum
+chmod
+ci
+cirrus
+cksum
+cmap
+comparator
+conn
+conntrack
+const
+cpu
+cpus
+cstime
+csum
+cutime
+cvlan
+datapath
+datapaths
+dbg
+debian
+decap
+decapsulation
+defrag
+defragment
+deref
+dereference
+dest
+dhcp
+dhcpv4
+dhcpv6
+dnat
+dns
+dpcls
+dpctl
+dpdk
+dpif
+dst
+eip
+encap
+enum
+enums
+eol
+epasv
+erspan
+ether
+ethernet
+ethertype
+ethtool
+eventmask
+faq
+fastpath
+fd
+fdb
+free
+freebsd
+FreeBSD
+gbps
+gcc
+gcloud
+geneve
+gid
+gigabits
+gigabytes
+github
+glibc
+goto
+gre
+gtime
+gw
+hashmap
+hashmaps
+hmap
+hotplug
+http
+https
+hugepage
+hugepages
+hw
+hwol
+icmp
+icmp4
+icmpv6
+idl
+ifindex
+initializer
+inlined
+int
+ip
+ipf
+ipfix
+ips
+ipsec
+ipv4
+ipv6
+ixgbe
+json
+jsonrpc
+kbps
+kilobits
+kilobytes
+l2
+l3
+l4
+lacp
+libbpf
+libcrypto
+libgcc
+libopenvswitch
+libreswan
+libssl
+libxdp
+linux
+liveness
+lldp
+llvm
+localnet
+lockless
+loopback
+malloc
+mbps
+mbuf
+mbufs
+mbundle
+mbundles
+mcast
+megabits
+megabytes
+megaflow
+megaflows
+memcmp
+mempool
+mempools
+memset
+metadata
+mfex
+miniflow
+misconfiguration
+misconfigured
+ms
+msec
+msg
+msgs
+mtu
+multicast
+mutex
+namespace
+nat
+nated
+natting
+ncat
+netdev
+netdevs
+netflow
+netlink
+networkmanager
+nic
+nicira
+nics
+ns
+nsec
+num
+numa
+odp
+ofctl
+ofpbuf
+ofpbufs
+ofport
+ofproto
+openflow
+openssl
+openvswitch
+opts
+ovs
+ovs-ctl
+ovsdb
+ovs-vswitchd
+pasv
+pcap
+pedit
+perf
+pgid
+pid
+pidfile
+pkts
+pmd
+pmds
+policer
+ppid
+pps
+pre
+prio
+promisc
+qdisc
+qos
+qsort
+rculist
+rebalance
+rebased
+recirc
+recirculation
+recirculations
+revalidate
+revalidation
+revalidator
+revalidators
+rhel
+rip
+rss
+rsslim
+rst
+rx
+rxq
+sbrec
+sed
+selinux
+sendmmsg
+sendmsg
+sflow
+shrinked
+sid
+sizeof
+skb
+skiplist
+slowpath
+smap
+snat
+src
+stats
+stderr
+stdout
+stime
+strcasecmp
+strcmp
+struct
+subnet
+subtable
+syscall
+tc
+tcp
+tcp4
+tcpv4
+testpmd
+tftp
+timeval
+tlv
+tlvs
+tpid
+travis
+trie
+tso
+tunctl
+tuple
+tx
+txq
+ubsan
+udp
+udp4
+udpv4
+ufid
+uid
+ukey
+umask
+unassociated
+unclosed
+unicast
+unixctl
+upcall
+upcalls
+us
+usec
+userspace
+util
+utime
+uuid
+uuid virtqueue
+valgrind
+vconn
+vconns
+veth
+vhost
+vhostuser
+virtio
+vlan
+vlans
+vms
+vnet
+vport
+vports
+vsize
+vswitch
+vswitchd
+vtep
+vxlan
+vxlans
+wc
+wget
+whcan
+wildcard
+x86_64
+xbundle
+xbundles
+xenserver
+xlate
+xlated
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 566a2bd60b..84956c23e3 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -56,71 +56,6 @@ def open_spell_check_dict():
         pass
 
     try:
-        extra_keywords = ['ovs', 'vswitch', 'vswitchd', 'ovs-vswitchd',
-                          'netdev', 'selinux', 'ovs-ctl', 'dpctl', 'ofctl',
-                          'openvswitch', 'dpdk', 'hugepage', 'hugepages',
-                          'pmd', 'upcall', 'vhost', 'rx', 'tx', 'vhostuser',
-                          'openflow', 'qsort', 'rxq', 'txq', 'perf', 'stats',
-                          'struct', 'int', 'char', 'bool', 'upcalls', 'nicira',
-                          'bitmask', 'ipv4', 'ipv6', 'tcp', 'tcp4', 'tcpv4',
-                          'udp', 'udp4', 'udpv4', 'icmp', 'icmp4', 'icmpv6',
-                          'vlan', 'vxlan', 'cksum', 'csum', 'checksum',
-                          'ofproto', 'numa', 'mempool', 'mempools', 'mbuf',
-                          'mbufs', 'hmap', 'cmap', 'smap', 'dhcpv4', 'dhcp',
-                          'dhcpv6', 'opts', 'metadata', 'geneve', 'mutex',
-                          'netdev', 'netdevs', 'subtable', 'virtio', 'qos',
-                          'policer', 'datapath', 'tunctl', 'attr', 'ethernet',
-                          'ether', 'defrag', 'defragment', 'loopback', 'sflow',
-                          'acl', 'initializer', 'recirc', 'xlated', 'unclosed',
-                          'netlink', 'msec', 'usec', 'nsec', 'ms', 'us', 'ns',
-                          'kilobits', 'kbps', 'kilobytes', 'megabytes', 'mbps',
-                          'gigabytes', 'gbps', 'megabits', 'gigabits', 'pkts',
-                          'tuple', 'miniflow', 'megaflow', 'conntrack',
-                          'vlans', 'vxlans', 'arg', 'tpid', 'xbundle',
-                          'xbundles', 'mbundle', 'mbundles', 'netflow',
-                          'localnet', 'odp', 'pre', 'dst', 'dest', 'src',
-                          'ethertype', 'cvlan', 'ips', 'msg', 'msgs',
-                          'liveness', 'userspace', 'eventmask', 'datapaths',
-                          'slowpath', 'fastpath', 'multicast', 'unicast',
-                          'revalidation', 'namespace', 'qdisc', 'uuid',
-                          'ofport', 'subnet', 'revalidation', 'revalidator',
-                          'revalidate', 'l2', 'l3', 'l4', 'openssl', 'mtu',
-                          'ifindex', 'enum', 'enums', 'http', 'https', 'num',
-                          'vconn', 'vconns', 'conn', 'nat', 'memset', 'memcmp',
-                          'strcmp', 'strcasecmp', 'tc', 'ufid', 'api',
-                          'ofpbuf', 'ofpbufs', 'hashmaps', 'hashmap', 'deref',
-                          'dereference', 'hw', 'prio', 'sendmmsg', 'sendmsg',
-                          'malloc', 'free', 'alloc', 'pid', 'ppid', 'pgid',
-                          'uid', 'gid', 'sid', 'utime', 'stime', 'cutime',
-                          'cstime', 'vsize', 'rss', 'rsslim', 'whcan', 'gtime',
-                          'eip', 'rip', 'cgtime', 'dbg', 'gw', 'sbrec', 'bfd',
-                          'sizeof', 'pmds', 'nic', 'nics', 'hwol', 'encap',
-                          'decap', 'tlv', 'tlvs', 'decapsulation', 'fd',
-                          'cacheline', 'xlate', 'skiplist', 'idl',
-                          'comparator', 'natting', 'alg', 'pasv', 'epasv',
-                          'wildcard', 'nated', 'amd64', 'x86_64',
-                          'recirculation', 'linux', 'afxdp', 'promisc', 'goto',
-                          'misconfigured', 'misconfiguration', 'checkpatch',
-                          'debian', 'travis', 'cirrus', 'appveyor', 'faq',
-                          'erspan', 'const', 'hotplug', 'addresssanitizer',
-                          'ovsdb', 'dpif', 'veth', 'rhel', 'jsonrpc', 'json',
-                          'syscall', 'lacp', 'ipf', 'skb', 'valgrind',
-                          'appctl', 'arp', 'asan', 'backport', 'backtrace',
-                          'chmod', 'ci', 'cpu', 'cpus', 'dnat', 'dns', 'dpcls',
-                          'eol', 'ethtool', 'fdb', 'freebsd', 'gcc', 'github',
-                          'glibc', 'gre', 'inlined', 'ip', 'ipfix', 'ipsec',
-                          'ixgbe', 'libbpf', 'libcrypto', 'libgcc',
-                          'libopenvswitch', 'libreswan', 'libssl', 'libxdp',
-                          'lldp', 'llvm', 'lockless', 'mcast', 'megaflows',
-                          'mfex', 'ncat', 'networkmanager', 'pcap', 'pedit',
-                          'pidfile', 'pps', 'rculist', 'rebalance', 'rebased'
-                          'recirculations', 'revalidators', 'rst', 'sed',
-                          'shrinked', 'snat', 'stderr', 'stdout', 'testpmd',
-                          'tftp', 'timeval', 'trie', 'tso', 'ubsan', 'ukey',
-                          'umask', 'unassociated', 'unixctl', 'uuid'
-                          'virtqueue', 'vms', 'vnet', 'vport', 'vports',
-                          'vtep', 'wc', 'wget', 'xenserver', 'util']
-
         global spell_check_dict
 
         spell_check_dict = enchant.Dict("en_US")
@@ -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(), "build-aux",
+                               "spelling_words.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())
 
         return True
     except:
-- 
2.47.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to