Commit 1d897ae
authored
htmlreport: support remote GitHub/GitLab links for source files (danmar#7988)
Motivation:
Cppcheck-htmlreport previously generated local annotated HTML for all
source files. For private or large repositories, generating local HTML
is unnecessary and cumbersome. It consumes additional disk space,
increases report generation time, and duplicates functionality already
provided by GitHub/GitLab browseable HTML pages. This patch allows the
cppcheck report itself to be public, while the actual source code
remains protected on GitHub/GitLab using their standard access controls.
Changes:
- Detect --source-dir URLs pointing to GitHub/GitLab.
- Use remote URLs in index.html instead of generating local HTML for
those files.
- Line numbers link directly to GitHub/GitLab with proper anchors
(#L123).
- Remote links open in a new tab (target="_blank"), preserving local
HTML behavior for normal files.
Signed-off-by: Robin Getz <[email protected]>1 parent 2fee3b4 commit 1d897ae
3 files changed
+91
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
498 | 509 | | |
499 | | - | |
| 510 | + | |
500 | 511 | | |
501 | 512 | | |
502 | 513 | | |
| |||
675 | 686 | | |
676 | 687 | | |
677 | 688 | | |
678 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
679 | 692 | | |
680 | 693 | | |
681 | 694 | | |
| |||
705 | 718 | | |
706 | 719 | | |
707 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
708 | 725 | | |
709 | 726 | | |
710 | 727 | | |
| |||
753 | 770 | | |
754 | 771 | | |
755 | 772 | | |
756 | | - | |
757 | | - | |
758 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
759 | 781 | | |
760 | 782 | | |
761 | 783 | | |
| |||
795 | 817 | | |
796 | 818 | | |
797 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
798 | 825 | | |
799 | 826 | | |
800 | 827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | | - | |
1162 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1163 | 1166 | | |
1164 | 1167 | | |
1165 | 1168 | | |
1166 | 1169 | | |
1167 | 1170 | | |
1168 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1169 | 1196 | | |
1170 | 1197 | | |
1171 | 1198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
1202 | | - | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
1203 | 1206 | | |
1204 | 1207 | | |
1205 | 1208 | | |
1206 | 1209 | | |
1207 | 1210 | | |
1208 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1209 | 1236 | | |
1210 | 1237 | | |
1211 | 1238 | | |
| |||
0 commit comments