You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📋 Audit: An audit per node. [ 'classes-coverage', 'methods-coverage', 'functions-coverage', 'interfaces-coverage', 'variables-coverage', 'properties coverage', 'types-coverage', 'enums-coverage']
🗂 Group: A general one grouping all the audits.
🗃 Category: A general one grouping all the audits.
🔨 Details maintenance
Minimum, there are not anything in particular to considerate.
Acceptance criteria
The plugin can be configured through parameters.
It can include and exclude files through patterns
Audits are filtered by onlyAudits or by skipAudits if specified.
Issues are grouped by an audit slug.
Audits are organized into logically linked groups.
Works with both TS and JS codebases.
Implementation details
With the library ts-morph, a "project" or "codebase" can be instantiated from the file patterns.
Then, we can retrieve every matching file found.
From each file, every possible node is retrieve
Every node is analyzed to determine if it's documented or not, and if it should analyze it's inside nodes in correlation (example, classes have methods inside and properties, not function and variables)
And then, every node, can BE ask for different information such as:
node.getKind()// What's the node? EX: 'method'node.getJsDocs().length// It's docummented? EX: 1 === true
name: node.getName()// What's the name of the node? EX: 'retrieveUsers'node.getStartLineNumber()// What's the line of the node? EX: 24
This information will be attached with some information of the sourceFile itself like the path:
Documentation Coverage Plugin
Documentation coverage of JS/TS codebases
Seamlessly analyze the coverage of documentation of your codebase.
🧪 Reference PR
👉 #896 - Documentation Coverage Plugin PoC
Metric
Documentation coverage based on JSDocs present on the codebase.
User Story
As a developer, or as a team lead, I want to ensure that the codebase documentation coverage does not get worse as the codebase grows:
The plugin should:
Setup and Requirements
📦Package Dependencies
📝 Configuration Files
N/A
📖 Audit, groups and category maintenance
📋 Audit: An audit per node. [ 'classes-coverage', 'methods-coverage', 'functions-coverage', 'interfaces-coverage', 'variables-coverage', 'properties coverage', 'types-coverage', 'enums-coverage']
🗂 Group: A general one grouping all the audits.
🗃 Category: A general one grouping all the audits.
🔨 Details maintenance
Minimum, there are not anything in particular to considerate.
Acceptance criteria
onlyAudits
or byskipAudits
if specified.Implementation details
A implementation of the plugin can be found here.
Setup
The plugin needs / accepts the following options:
Retrieving the files to analyze
Processing each file
Once the
sourceFiles
are get, every possible node is retrieved.And then, every node, can BE ask for different information such as:
This information will be attached with some information of the sourceFile itself like the path:
There is some extra logic in order to get methods and properties inside classes, but besides this:
That would wrap up the implementation details 🎁.
The text was updated successfully, but these errors were encountered: