Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for source control server links #16

Closed
Farigh opened this issue Jan 21, 2021 · 1 comment · Fixed by #18
Closed

Add support for source control server links #16

Farigh opened this issue Jan 21, 2021 · 1 comment · Fixed by #18
Labels
enhancement New feature or request
Milestone

Comments

@Farigh
Copy link
Owner

Farigh commented Jan 21, 2021

As part of the ci support, how about being able to click on a source file and being moved to the corresponding source control HTML page, on the right file and the right line.

The idea would be to allow users to define prefixes, for each prefix, an URL replacement should be provided.

The URL scheme seems to be standardized : ${url_to_project_prefixe}${file_subpath}#L${linenumber}` (at least for GitHub and GitLab)

For example, the following report:

==1== Conditional jump or move depends on uninitialised value(s)
==1==    at 0x10101042: myFunc() (/myotherprojectsrc/mylibs/lib1/MyClass.cpp:14)
==1==    by 0x10101042: main (/myprojectsrc/main.cpp:34)
==1==  Uninitialised value was created by a stack allocation
==1==    at 0x10101042: myFunc() (/myotherprojectsrc/mylibs/lib1/MyClass.cpp:5)

Could be tweeked in the config file:

memcheck_report_url_prefix_replacement["/myotherprojectsrc"]="http://github.com/example/example_project/tree/master/"
memcheck_report_url_prefix_replacement["/myprojectsrc"]="http://gitlab.com/example/example_lib_project/-/blob/master/"

And the generation would look like this:

==1== Conditional jump or move depends on uninitialised value(s)
==1==    at 0x10101042: myFunc() (<a href="http://github.com/example/example_project/tree/master/mylibs/lib1/MyClass.cpp#L14">/myotherprojectsrc/mylibs/lib1/MyClass.cpp:14</a>)
==1==    by 0x10101042: main (<a href="http://gitlab.com/example/example_lib_project/-/blob/master/mylibs/lib1/main.cpp#L34">/myprojectsrc/main.cpp:34</a>)
==1==  Uninitialised value was created by a stack allocation
==1==    at 0x10101042: myFunc() (<a href="http://github.com/example/example_project/tree/master/mylibs/lib1/MyClass.cpp#L5">/myotherprojectsrc/mylibs/lib1/MyClass.cpp:5</a>)

For a more representative link, the provided link should not refer to master but to the corresponding sha1 instead.

@Farigh Farigh added the enhancement New feature or request label Jan 21, 2021
@Farigh Farigh added this to the v1.2 milestone Jan 21, 2021
@Farigh
Copy link
Owner Author

Farigh commented Jan 21, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant