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

Documentation coverage plugin #900

Closed
7 tasks
BioPhoton opened this issue Dec 22, 2024 · 1 comment
Closed
7 tasks

Documentation coverage plugin #900

BioPhoton opened this issue Dec 22, 2024 · 1 comment
Assignees

Comments

@BioPhoton
Copy link
Collaborator

BioPhoton commented Dec 22, 2024

Metric

The plugin should measure the documentation coverage of a given code base scoped by a glob pattern.
Documentation coverage can get applied on any AST node of your TypeScript or JavaScript code.
It will detect if the node's comments are given and follow the official JSDoc standard.

The metrics value is the factor of total number of nodes to undocumented nodes.

That means if the codebase contains 10 nodes and 5 of them are uncommented the coverage would be:

  • value: 50
  • displayValue: 50
  • score: .5

User story

As a CodePushup user I want to have a plugin to keep track of the documentation coverage of my codebase.

Acceptance criteria

  • The plugin can track my documentation coverage based on the official JSDoc standard
  • The documentation coverage is applied for the following node types:
    • variable
    • enum
    • property
    • interface
    • function
    • class
    • method
    • types
  • The plugins configuration options:
    • accept a glob pattern to scope the checked files (exclude tests, internal implementation etc.)
    • properties to have fine-grained control on which audits are applied. The names are onlyAudity and skipAudits and accept multiple audit slugs
  • The plugin works for JavaScript as well as TypeScript format.
  • Undocumented nodes should get listed under details.issues and maintain the file, and line number. The type should be listed in the message.

Implementation details

await docCoverageCoreConfig({
    sourceGlob: [
      'packages/**/src/**/*.ts',
      '!**/*.test.ts',
      '!**/internal/**',
    ],
    skipAudits: ['methods-coverage'],
  })
@BioPhoton
Copy link
Collaborator Author

closed in favour of: #908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant