diff options
author | Willow Liquorice <willow@howhill.com> | 2022-08-26 03:58:34 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-08-30 09:41:50 +0200 |
commit | a0310df04b42d5b65f0f9cd2bd6c8c655507441c (patch) | |
tree | 1546fcd9760efdd09e5b227844b335613cf229fb | |
parent | f9886361c9ffde27de2a4833cfcee42f97c6c60a (diff) | |
download | gnunet-a0310df04b42d5b65f0f9cd2bd6c8c655507441c.tar.gz gnunet-a0310df04b42d5b65f0f9cd2bd6c8c655507441c.zip |
-Added workflow note to warningfilter.py
-rwxr-xr-x | contrib/warningfilter.py | 26 |
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 @@ | |||
3 | Filters and processes warnings generated by Doxygen, which are | 3 | Filters and processes warnings generated by Doxygen, which are |
4 | annoyingly inconsistent and verbose, to allow for easier reading. | 4 | annoyingly 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 | ||
66 | parser = ap.ArgumentParser() | 70 | parser = ap.ArgumentParser() |
67 | parser.add_argument("filename") | 71 | parser.add_argument("filename") |
68 | parser.add_argument("keys", choices=parser_choices, nargs="*") | 72 | parser.add_argument("--summary", "-s", action="store_true") |
73 | parser.add_argument("--key", "-k", choices=parser_choices, action="append", dest="keys") | ||
69 | args = parser.parse_args() | 74 | args = parser.parse_args() |
70 | 75 | ||
71 | sorted_lines = {k:[] for k in matches.keys()} | 76 | sorted_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 |
100 | counts = {k: len(v) for k, v in processed_lines.items()} | 105 | counts = {k: len(v) for k, v in processed_lines.items()} |
101 | for k, v in counts.items(): | 106 | if args.summary: |
102 | print(k+":", v) | 107 | for k, v in counts.items(): |
103 | print("") | 108 | print(k+":", v) |
104 | 109 | print("") | |
105 | for key in args.keys: | 110 | |
106 | print(f"{key}: {counts[key]}") | 111 | if 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 | ||