diff options
author | Daniil Baturin <daniil@vyos.io> | 2020-01-12 06:59:21 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2020-01-12 06:59:21 +0100 |
commit | 75dc5adb4f7d66c504740e3a7e3b34d33495562d (patch) | |
tree | b4353446e9b0c6aed8efc6d291f64aeef80c515b | |
parent | 2d84ea66e58687b39202607dfef995785b93c642 (diff) | |
download | vyos-sdk-75dc5adb4f7d66c504740e3a7e3b34d33495562d.tar.gz vyos-sdk-75dc5adb4f7d66c504740e3a7e3b34d33495562d.zip |
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | data/acronym-style | 80 | ||||
-rwxr-xr-x | scripts/acronym-checker.py | 56 |
3 files changed, 143 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..7284032 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +vyos-sdk +======== + +VyOS SDK is a set of scripts and data files required +to build VyOS component packages, including vyos-1x. + + diff --git a/data/acronym-style b/data/acronym-style new file mode 100644 index 0000000..ec89704 --- /dev/null +++ b/data/acronym-style @@ -0,0 +1,80 @@ + +ACL +AMI +ARP +BFD +BGP +CARP +CHIM +DHCP +DHCP-PD +DHCPv6 +DMVPN +DNS +ESXi +FTP +GENEVE +GRE +GRE/IPsec +h.323 +HTTP +HTTPS +Hyper-V +ICMP +IGMP +IP +IPIP +IPsec +IPv4 +IPv6 +ISIS +IS-IS +ISO +KVM +L2TP +L2TPv3 +LACP +LDP +LLDP +mDNS +MPLS +MSS +MTU +NAT +NDP +NHRP +OpenVPN +OSPF +OSPFv2 +OSPFv3 +PBD +PoE +PPPoE +PPTP +QinQ +QoS +RIP +RIPng +RIPv2 +RPKI +RTP +SIP +SNMP +SNMPv3 +SSH +TCP +TCP/IP +TFTP +UDP +VLAN +VMware +VPN +VRRP +VXLAN +VyOS +WEP +WPA +WPA2 +WTF +Xen +XML diff --git a/scripts/acronym-checker.py b/scripts/acronym-checker.py new file mode 100755 index 0000000..e0c7845 --- /dev/null +++ b/scripts/acronym-checker.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2019 VyOS maintainers <maintainers@vyos.net> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA +# +# Checks capitalization of abbreviations/acronyms. +# In the style file, they should be given one per line, +# correctly capitalized. + +import re +import sys + +if len(sys.argv) < 3: + print("Usage: {0} <style file> <target file>") + sys.exit(1) + +line_no = 1 +# Assume success until proven otherwise +exit_code = 0 + +# Get the style data +with open(sys.argv[1], 'r') as f: + abbr_list = f.readlines() +abbr_list = map(lambda s: s.strip(), abbr_list) + +abbrs = {} +for a in abbr_list: + abbrs[a.lower()] = a + +with open(sys.argv[2], 'r') as f: + for line in f: + words = re.split(r'\s+', line) + for w in words: + wl = w.lower() + if (wl in abbrs) and (w != abbrs[wl]): + print("Line {0}: Incorrect capitalization of {1} ({2})!".format(line_no, abbrs[wl], w)) + print(line) + exit_code = 1 + line_no += 1 + +sys.exit(exit_code) + |