diff --git a/tools/extract-formats.py b/tools/extract-formats.py index ce0f8b0..006ce62 100755 --- a/tools/extract-formats.py +++ b/tools/extract-formats.py @@ -67,15 +67,15 @@ parser.add_option("--message-fields", # Example inputs: # 1. type: 17 (`error`) # 2. data: -# * [8:channel-id] -# * [4:len] -# * [len:data] +# * [`8`:`channel_id`] +# * [`4`:`len`] +# * [`len`:`data`] # # 1. type: PERM|NODE|3 (`required_node_feature_missing`) message = None havedata = None -typeline = re.compile('1\. type: (?P[-0-9A-Za-z_|]+) \(`(?P[-A-Za-z_]+)`\)') -dataline = re.compile('\s+\* \[(?P[-a-z0-9*+]+):(?P[-a-z0-9_]+)\]') +typeline = re.compile('1\. type: (?P[-0-9A-Za-z_|]+) \(`(?P[A-Za-z_]+)`\)') +dataline = re.compile('\s+\* \[`(?P[_a-z0-9*+]+)`:`(?P[_a-z0-9]+)`\]') for i,line in enumerate(fileinput.input(args)): line = line.rstrip() diff --git a/tools/spellcheck.sh b/tools/spellcheck.sh index 224f97d..c8150f9 100755 --- a/tools/spellcheck.sh +++ b/tools/spellcheck.sh @@ -51,15 +51,15 @@ do if [ -n "$CHECK" ]; then # Eliminate the following: # #-references eg. [Use of segwit](#use-of-segwit) - # quoted identifers eg. `htlc-id` - # field descriptions, eg. `* [num-htlcs*64:htlc-signature]' - # indented field names, eg. ' num_htlcs: 0' + # quoted identifers eg. `htlc_id` + # field descriptions, eg. `* [`num_htlcs*64`:`htlc_signature]' + # indented field names, eg. ' `num_htlcs`: 0' # Short hex strings, eg '0x2bb038521914' # long hex strings # long base58 strings WORDS=$(sed -e 's/\](#[-a-zA-Z0-9_]*)//g' \ - -e 's/`[-a-zA-Z0-9_]*`//g' \ - -e 's/\* \[[-_a-z0-9*]\+:[-_a-z0-9]\+\]//g' \ + -e 's/`[a-zA-Z0-9_]*`//g' \ + -e 's/\* \[`[_a-z0-9*]\+`://g' \ -e 's/0x[a-fA-F0-9]\+//g' \ -e 's/[a-fA-F0-9]\{20,\}//g' \ -e 's/^ .*_htlcs//g' \