Tweak docs about test coverage and git blame

This commit is contained in:
Justin Mayer 2024-06-16 19:23:46 +02:00
commit e262990c68

View file

@ -64,19 +64,26 @@ your bug fix or feature::
Now you can make changes to Pelican, its documentation, and/or other aspects of Now you can make changes to Pelican, its documentation, and/or other aspects of
the project. the project.
Setting up git blame Setting up ``git blame`` (optional)
-------------------- -----------------------------------
``git blame`` annotates lines from a file with information about the pull request ``git blame`` annotates lines in a file with information about the pull request
that last modified it. Sweeping shallow changes (like formatting) can make that that last modified it. Sweeping shallow changes (like formatting) can make that
information less useful, so we keep a list of such changes to be ignored. To set information less useful, so we keep a list of such changes to be ignored. Run the
that up in your repository:: following command to set this up in your repository, adding ``--global`` if you
want this setting to apply to all repositories::
git config blame.ignoreRevsFile .git-blame-ignore-revs git config blame.ignoreRevsFile .git-blame-ignore-revs
For more information, see here_. As noted in a `useful article`_ about ``git blame``, there are other related
settings you may find to be beneficial::
.. _here: https://www.michaelheap.com/git-ignore-rev/ # Add `?` to any lines that have had a commit skipped using --ignore-rev
git config --global blame.markIgnoredLines true
# Add `*` to any lines that were added in a skipped commit and can not be attributed
git config --global blame.markUnblamableLines true
.. _useful article: https://www.michaelheap.com/git-ignore-rev/
Running the test suite Running the test suite
---------------------- ----------------------
@ -125,16 +132,17 @@ environments.
Running a code coverage report Running a code coverage report
------------------------------ ------------------------------
The code is more likely to stay robust if it is tested. Code is more likely to stay robust if it is tested. Coverage_ is a library that
coverage_ is a library that measures how much of the code is tested. measures how much of the code is tested. To run it::
To run it::
invoke coverage invoke coverage
This will show overall coverage, coverage per file, and even line-by-line coverage.
There is also an HTML report available::
open htmlcov/index.html open htmlcov/index.html
The HTML will show overall coverage, coverage per file, and even line-by-line coverage. .. _Coverage: https://github.com/nedbat/coveragepy
.. _coverage: https://github.com/nedbat/coveragepy
Building the docs Building the docs
----------------- -----------------