Skip to content

Commit 346f9b7

Browse files
Show matched test diagnostics for --todo issues
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent abd0f64 commit 346f9b7

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/summarycode/todo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,11 @@ def from_license(cls, detection, detection_log, file_regions):
317317
license_diagnostics = False
318318
if detection_object.detection_log != None:
319319
license_diagnostics = True
320+
license_text_diagnostics = True
320321
detection_mapping = detection_object.to_dict(
321322
include_text=True,
322323
license_diagnostics=license_diagnostics,
324+
license_text_diagnostics=license_text_diagnostics,
323325
)
324326
return cls(
325327
detection_type='license',

tests/summarycode/data/todo/todo_present/README.multi-orig-tarball-package-expected-diag.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"rule_notes": null,
2929
"referenced_filenames": [],
3030
"matched_text": "This src:package consists of various tarballs.\n\nThis README is a dummy file for creating the base tarball of the name",
31+
"matched_text_diagnostics": "package consists of [various] [tarballs].\n\n[This] README",
3132
"rule_text": "Copyright 1993 Francis Borceux\nYou may freely use, modify, and/or distribute each of the files in this package without limitation. The package consists of the following files:\n\nREADME\ncompatibility/OldDiagram\ncompatibility/OldMaxiDiagram\ncompatibility/OldMicroDiagram\ncompatibility/OldMiniDiagram\ncompatibility/OldMultipleArrows\ndiagram/Diagram\ndiagram/MaxiDiagram\ndiagram/MicroDiagram\ndiagram/MiniDiagram\ndiagram/MultipleArrows\nuser-guides/Diagram_Mode_d_Emploi\nuser-guides/Diagram_Read_Me\n\nOf course no support is guaranteed, but the author will attempt to assist with problems. Current email address:\nfrancis dot borceux at uclouvain dot be."
3233
}
3334
],

tests/summarycode/data/todo/todo_present/unknown-license-expected-diag.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"rule_notes": "Unknown license based on a composite of license words.",
5757
"referenced_filenames": [],
5858
"matched_text": "form shall mean the preferred form for making\nthe purposes of this definition control\nsoftware is modified by someone else\n\n\n\nrepresent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.",
59+
"matched_text_diagnostics": "form shall mean the preferred form for making\nthe purposes of this definition control\n[software] [is] [modified] [by] [someone] [else]\n\n\n\nrepresent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) [to] [the] interfaces of,\n the Work and Derivative Works thereof.",
5960
"rule_text": "form shall mean the preferred form for making\nthe purposes of this definition control\nsoftware is modified by someone else\n\n\n\nrepresent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof."
6061
}
6162
],

0 commit comments

Comments
 (0)