8000 Split User Guide into smaller parts by latk · Pull Request #552 · gcovr/gcovr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Split User Guide into smaller parts #552

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

Merged
merged 19 commits into from
Mar 25, 2022
Merged

Split User Guide into smaller parts #552

merged 19 commits into from
Mar 25, 2022

Conversation

latk
Copy link
Member
@latk latk commented Jan 8, 2022

The user guide was getting extremely long and unwieldy. This pull request proposes to split it up into separate pages. For example, every output format now has its own page.

Downsides: more complicated URL structure, breaks existing links into the documentation.

This also helped to separate some concerns that had become mixed. Originally, the user guide started with a quickstart guide. Then, more and more output formats came along. The result was that the documentation for the txt output (the oldest format) also served as a tutorial for using gcovr. Now, those more tutorial-style parts have been moved to separate pages.

Other changes:

  • rewrote tutorial-style content as a “Compiling for Coverage” page that explains compiler flags etc
  • rename the “Combining Tracefiles” section to “Merging Coverage Data” as “tracefile” is a lcov-specific term
  • fix the awful formatting of the README on GitHub. It is now a normal table. But this was more complicated than expected, with the two versions now being defined by a TON of substitution references.
  • QA improvements relating to docs in the release_checklist and the Noxfile
  • simplifying examples around the -r and -o options – they are usually unnecessary

The pull request is split into multiple commits that can be reviewed one at a time.

@latk latk added the Docs related to the documentation or website label Jan 8, 2022
@latk latk added this to the 5.1 milestone Jan 8, 2022
@codecov
Copy link
codecov bot commented Jan 8, 2022

Codecov Report

Merging #552 (5ab4bc3) into master (f1baf77) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #552      +/-   ##
==========================================
+ Coverage   95.71%   95.76%   +0.05%     
==========================================
  Files          23       23              
  Lines        3315     3331      +16     
  Branches      609      610       +1     
==========================================
+ Hits         3173     3190      +17     
  Misses         69       69              
+ Partials       73       72       -1     
Flag Coverage Δ
ubuntu-18.04 94.62% <100.00%> (+0.05%) ⬆️
windows-2019 95.45% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gcovr/__main__.py 91.81% <100.00%> (ø)
gcovr/configuration.py 99.66% <100.00%> (+0.36%) ⬆️
gcovr/utils.py 91.26% <100.00%> (+0.11%) ⬆️
gcovr/writer/cobertura.py 98.29% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1baf77...5ab4bc3. Read the comment docs.

Copy link
Member
@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM, only some little comments.

latk added a commit to latk/gcovr that referenced this pull request Jan 22, 2022
latk added a commit to latk/gcovr that referenced this pull request Jan 22, 2022
@latk latk added cli relating to the command line interface or the config system Format: Sonarcube Type: Enhancement labels Jan 22, 2022
@latk latk requested a review from Spacetown January 22, 2022 23:08
Copy link
Member
@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM only the text of the links in the overview isn't changed yet.

3. Running the program will increment the in-memory coverage counters.
At the en 8000 d, the counters are written into gcov data files,
one for each compilation unit.
Here, we would get ``a.gcda`` and ``b.gcda`` files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they always written or only if the code was executed? CTC for example only generates a file if the counters where incremented.

@Spacetown Spacetown mentioned this pull request Mar 14, 2022
@Spacetown
Copy link
Member

@latk Is the latest version of your branch pushed? If so, I can update the files with the changes of #561 and solve the merge conflicts.

latk added 15 commits March 24, 2022 22:47
Now, every output format has its own page for tutorial and reference content.
The individual pages should now be more easily digestible. If one section like
Filters contains more content, it doesn't distract from the other sections.
The `--add-tracefiles` option terminology was borrowed from lcov. Lcov refers to
its .info files as tracefiles, and indeed these play a similar role as our JSON
files. However, gcovr doesn't use the "tracefile" terminology in any other
place. So I think it is clearer to talk about "merging coverage data" instead.
The README is the de-facto landing page of the project. It includes a nice list
of supported output formats, along with a link to the command line option.

UNFORTUNATELY, this link uses Sphinx syntax that is not supported by the normal
RST (docutils) renderer. This leads to a really ugly view on GitHub with raw RST
syntax. For example:

    * :option:`--html<gcovr --html>`: HTML summaries

SOLUTION: the list is now formatted as a table consisting of RST substitution
references. The table is written in the README file but also included on the
website. Each variant defines these substitutions differently:

* The README version renders the CLI flags as verbatim text without links.
  Links to the guides go to the stable version of the website.

* The website version renders the flags and guide links via the expected Sphinx
  syntax.

Drawback of this change is that it will take more effort to maintain these
links. It's also less than ideal to link to the stable version, but that seems
to be the best approach when considering that outside users are likely to follow
these links.
Previously, tutorial-level explanation on compiling for coverage was part of the
TXT format documentation.

Now, it was moved to a separate page.
The root option defaults to the current directory `.` so mentioning it
explicitly is unnecessary and distracting.

Similarly, explicit --output flags are best avoided.
(and fix some of the other entries that confused me)
and apply slight modernizations, e.g. replacing str.format() with f""-strings.
latk added 3 commits March 25, 2022 12:02
and migrate string formatting to f""-strings
The "XML" format is a confusing name since it could relate to both the Cobertura
and Sonarqube output. This commit adds the --cobertura option as a less
confusing alternative. The documentation was updated throughout to nudge the
user towards this option.

As a side effect, this changes the config file key from `xml` to `cobertura`.

This commit does not deprecate the old -x/--xml/--xml-pretty option names,
but only because it is not reasonably possible to emit a deprecation message.
In contrast, the configuration key had to be renamed since config keys cannot
have aliases.

The following approaches for generating a deprecation warning with argparse were
considered but ultimately discarded:

* wrapping the "type" conversion function for the argument.
  This doesn't work because a "type" function is not supported for some "action"
  types.

* implementing custom "action" types.
  This would require re-implementing the argparse._StoreAction classes and so
  on, which is a lot of work for limited gain. While argparse does offer a
  stable interface for custom actions, this would require further
  integration/reimplementation of argparse details.

* writing a custom argparse replacement.
  This is not insane since value conversion is already highly customized,
  and all that argparse provides is associating --option names with their
  values. However, we cannot get rid of argparse without also rewriting the
  Sphinx-Autoprogram extension.
latk added a commit to latk/gcovr that referenced this pull request Mar 25, 2022
* docs: clarify when coverage counters are updated
* docs: mention that symlinks are supported on Windows
* configuration: explicitly break exception chaining
@latk latk force-pushed the structured-docs branch from 83ccb44 to 8d4c389 Compare March 25, 2022 11:19
@latk
Copy link
Member Author
latk commented Mar 25, 2022

CI is currently not running due to scheduled maintenance on GH actions, but should resume later today.

* docs: clarify when coverage counters are updated
* docs: mention that symlinks are supported on Windows
* configuration: explicitly break exception chaining
@latk latk force-pushed the structured-docs branch from 8d4c389 to 5ab4bc3 Compare March 25, 2022 16:32
@latk latk merged commit 70b7185 into gcovr:master Mar 25, 2022
latk added a commit that referenced this pull request Mar 25, 2022
D-Walther pushed a commit to D-Walther/gcovr that referenced this pull request Jun 16, 2025
D-Walther pushed a commit to D-Walther/gcovr that referenced this pull request Jun 16, 2025
* docs: clarify when coverage counters are updated
* docs: mention that symlinks are supported on Windows
* configuration: explicitly break exception chaining
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli relating to the command line interface or the config system Docs related to the documentation or website Format: Sonarcube Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0