Lines Matching +full:1 +full:d +full:- +full:histogram

3 # SPDX-License-Identifier: GPL-2.0-only
7 # - option to just list all broken files
8 # - test suite
9 # - validate signed-off-by
11 … = ("accepted", "pending", "inappropriate", "backport", "submitted", "denied", "inactive-upstream")
14 # Whether the patch has an Upstream-Status or not
16 # If the Upstream-Status tag is malformed in some way (string for bad bit)
18 # If the Upstream-Status value is unknown (boolean)
22 # Whether the patch has a Signed-off-by or not
24 # Whether the Signed-off-by tag is malformed in some way
26 # The Signed-off-by tag value
38 "--follow", "--find-renames", "--diff-filter=A",
39 "--format=%s (%aN <%aE>)",
40 "--", patch)).decode("utf-8").splitlines()
48 sob_re = re.compile(r"^[\t ]*(Signed[-_ ]off[-_ ]by:?)[\t ]*(.+)", re.IGNORECASE | re.MULTILINE)
49 …status_re = re.compile(r"^[\t ]*(Upstream[-_ ]Status:?)[\t ]*([\w-]*)", re.IGNORECASE | re.MULTILI…
51 cve_re = re.compile(r"cve-[0-9]{4}-[0-9]{4,6}", re.IGNORECASE)
63 # Find the Signed-off-by tag
66 value = match.group(1)
67 if value != "Signed-off-by:":
74 # Find the Upstream-Status tag
77 value = match.group(1)
78 if value != "Upstream-Status:":
101 verbose: display per-file results instead of just summary
118 total_patches += 1
123 missing_sob += 1
125 malformed_sob += 1
127 missing_status += 1
129 malformed_status += 1
131 pending_patches +=1
133 missing_cve += 1
135 pending_patches += 1
141 print("Missing Signed-off-by tag (%s)" % patch)
145 print("Malformed Signed-off-by '%s' (%s)" % (r.malformed_sob, patch))
153 print("Missing Upstream-Status tag (%s)" % patch)
157 print("Malformed Upstream-Status '%s' (%s)" % (r.malformed_upstream_status, patch))
161 print("Unknown Upstream-Status value '%s' (%s)" % (r.upstream_status, patch))
168 return "%d (%d%%)" % (num, round(num * 100.0 / total_patches))
175 print("""Total patches found: %d
176 Patches missing Signed-off-by: %s
177 Patches with malformed Signed-off-by: %s
179 Patches missing Upstream-Status: %s
180 Patches with malformed Upstream-Status: %s
191 def histogram(results): function
197 print("%-20s %s (%d)" % (k.capitalize() if k else "No status", bars[k], counts[k]))
204 args.add_argument("-b", "--blame", action="store_true", help="show blame for malformed patches")
205 args.add_argument("-v", "--verbose", action="store_true", help="show per-patch results")
206 args.add_argument("-g", "--histogram", action="store_true", help="show patch histogram")
207 args.add_argument("-j", "--json", help="update JSON")
211 …process.check_output(("git", "-C", args.directory, "ls-files", "recipes-*/**/*.patch", "recipes-*/…
224 …bprocess.check_output(["git", "-C", args.directory, "show", "-s", "--pretty=format:%cd", "--date=f…
227 row[r.upstream_status] += 1
229 row['malformed-upstream-status'] += 1
231 row['malformed-sob'] += 1
236 if args.histogram:
238 histogram(results)