Repository navigation
Documentation coverage: a page per package and module, with a condensed listing - #35
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 15 minor |
| CodeStyle | 8 minor |
| Complexity | 1 minor |
🟢 Metrics 190 complexity · 4 duplication
Metric Results Complexity 190 Duplication 4
🟢 Coverage 96.65% diff coverage · +1.75% coverage variation
Metric Results Coverage variation ✅ +1.75% coverage variation (-1.00%) Diff coverage ✅ 96.65% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (a466998) 3308 2729 82.50% Head commit (6dd8c94) 3733 (+425) 3145 (+416) 84.25% (+1.75%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#35) 478 462 96.65% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #35 +/- ##
==========================================
+ Coverage 80.04% 81.75% +1.70%
==========================================
Files 19 21 +2
Lines 3308 3733 +425
Branches 502 568 +66
==========================================
+ Hits 2648 3052 +404
- Misses 579 588 +9
- Partials 81 93 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
…ed listing A package in pyTooling_DocCoverage_Packages declared with 'pages' gets a generated page per package and module, linked from the report:doc-coverage table and listed in the navigation below it, like the code coverage pages. A page shows the counters, colored by coverage level; a package's page its sub-packages and modules. The role ':doccov:' refers to a page. A module's listing is its source condensed to what is documented: decorators, headers - multi-line signatures as written - and doc-strings of classes and functions, fields and variables with their '#:' comments; a body and the imports are elided to one '...' line. Each class and function is marked by docstr_coverage's state; fields and variables are marked only if pyEDAA.Reports' model holds a state for them. HTML and LaTeX share the listing code with the code coverage listing. The packages are analyzed once per build, when the builder is initialized, instead of per directive. The own documentation dogfoods the pages, and the directive's page shows a fixture package. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…errors CondensedSource moves into a module of its own, so no file exceeds 700 lines. Its constructor takes the condensed lines; the classmethod Parse condenses a module's source with a private builder, which holds the state while walking the syntax tree. Analyzing a package keeps only the exceptions the analysis raises - ReportExtensionError (pyEDAA.Reports missing, or its DocCoverageError), OSError, SyntaxError, tokenize.TokenError and UnicodeDecodeError -, which GetReport chains; any other exception ends the build. The documentation coverage report moves to doccoverage/index.rst, above its pages doccoverage/src, as the code coverage report does. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
0c55446 to
6dd8c94
Compare
New Features
pyTooling_DocCoverage_Packageswith"pages": "<document name>"gets a page per package and per module, generated below that name, linked from the rows of thereport:doc-coveragetable and listed in the navigation below the page holding the directive - as code coverage does.pyTooling.Sphinx.CondensedSource):...line;..., except nested classes and functions; a class' members follow;#:comment or doc-string literal;if/tryholding definitions as written, its definitions condensed.:doccov:(object typemodule) referring to a package's or module's page; the domain'sdata_versionis 2.pyTooling.Sphinx.Node.DocCoverageListingwith HTML and LaTeX visitors; both listings sharehighlightTokens/writeListing.pyTooling.Sphinx.Pages.ReportPages._Source(entity): the source file of a page, so a module's file triggers a rebuild of its page.Changes
DocCoverageBase.AnalyzePackages), instead of by every directive. A package that can't be analyzed -OSError,SyntaxError,tokenize.TokenError,UnicodeDecodeError, or pyEDAA.Reports'DocCoverageError- is reported by the directive and the pages naming it (GetReportchains the cause); any other exception ends the build.pagesis checked like code coverage's.LevelOf(levels, coverage, configKey): the level lookup as a static method, shared by the table and the pages.Known Issues
DocStrCoverage.CoverageReport), matched to the source in visit order, names checked: pyEDAA.Reports'Convert()fills only per-file counts, no per-item states. A mismatch is warned about, and the listing stays unmarked.Variables/Fields, so a later analyzer filling them marks them without a change here. Research on such an analyzer: see the discussion of tree: a legend explaining the icons #32.Documentation
doc/Directives/DocCoverage.rst: section on the pages and the listing; the page renders a fixture package (example, pages belowdoccoverage/example).doc/DocCoverage.rstmoves todoc/doccoverage/index.rst(labelDOCCOV), withpages: doccoverage/src- the same layout ascoverage/index.rstwithcoverage/srcin Documentation: pages for the own unit test and code coverage reports #33.doc/News.rst: the pages in v0.1.0's new features.Unit Tests
tests/unit/DocCoveragePages.pywith the fixture packagetests/data/DocCoverage/myPackage/: configuration, pages and links, the condensed listing (signatures kept, bodies elided, doc-strings and#:comments present, states marked), a source not matching the analysis, a package with a syntax error, the root package's page.tests/unit/UnittestPages.py: the domain data built by hand needs the new role's key.Related Issues and Pull-Requests
coverage/index.rst, unit test pages): the documentation now has pages belowunittests/src,coverage/srcanddoccoverage/src.