aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillow Liquorice <willow@howhill.com>2022-08-26 03:58:34 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-08-30 09:41:50 +0200
commita0310df04b42d5b65f0f9cd2bd6c8c655507441c (patch)
tree1546fcd9760efdd09e5b227844b335613cf229fb
parentf9886361c9ffde27de2a4833cfcee42f97c6c60a (diff)
downloadgnunet-a0310df04b42d5b65f0f9cd2bd6c8c655507441c.tar.gz
gnunet-a0310df04b42d5b65f0f9cd2bd6c8c655507441c.zip
-Added workflow note to warningfilter.py
-rwxr-xr-xcontrib/warningfilter.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/contrib/warningfilter.py b/contrib/warningfilter.py
index 7b28c81dc..dce8997ce 100755
--- a/contrib/warningfilter.py
+++ b/contrib/warningfilter.py
@@ -3,6 +3,10 @@
3Filters and processes warnings generated by Doxygen, which are 3Filters and processes warnings generated by Doxygen, which are
4annoyingly inconsistent and verbose, to allow for easier reading. 4annoyingly inconsistent and verbose, to allow for easier reading.
5 5
6(Neo)vim commands to go to the file in a report:
7 :exe "let linenumber =" split(getline("."))[1]
8 :exe "edit" fnameescape(split(getline("."))[0]) "|" linenumber
9
6@author: willow <willow@howhill.com> 10@author: willow <willow@howhill.com>
7""" 11"""
8 12
@@ -65,7 +69,8 @@ parser_choices = set(matches.keys()) - {"blank",
65 69
66parser = ap.ArgumentParser() 70parser = ap.ArgumentParser()
67parser.add_argument("filename") 71parser.add_argument("filename")
68parser.add_argument("keys", choices=parser_choices, nargs="*") 72parser.add_argument("--summary", "-s", action="store_true")
73parser.add_argument("--key", "-k", choices=parser_choices, action="append", dest="keys")
69args = parser.parse_args() 74args = parser.parse_args()
70 75
71sorted_lines = {k:[] for k in matches.keys()} 76sorted_lines = {k:[] for k in matches.keys()}
@@ -98,12 +103,15 @@ del processed_lines["undocumented param (name)"]
98 103
99# Preparing count dictionary and summarising the results 104# Preparing count dictionary and summarising the results
100counts = {k: len(v) for k, v in processed_lines.items()} 105counts = {k: len(v) for k, v in processed_lines.items()}
101for k, v in counts.items(): 106if args.summary:
102 print(k+":", v) 107 for k, v in counts.items():
103print("") 108 print(k+":", v)
104 109 print("")
105for key in args.keys: 110
106 print(f"{key}: {counts[key]}") 111if args.keys is not None:
107 for line in processed_lines[key]: 112 for key in args.keys:
108 print(line) 113 print(f"{key}: {counts[key]}")
114 for line in processed_lines[key]:
115 print(line)
116 print("")
109 117