-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Calculate Documentation Percentage #64
Comments
Hi @leogdion, thank you for the suggestion. This is an interesting topic, and feature. Where to calculate the percentage will depend on your definition:
In terms of calculation, SourceDocs loads all entities (classes, methods, etc) from code, whether they are documented or not. We could count the number of entities that have documentation and calculate the percentage. The best place to do that would probably be in |
I was thinking something fairly simple:
In other words just output the value with the command output (not included in any markdown files). My intention is to include it as part of my pre-commit hook or CI to ensure my documentation is up to certain threshold similar to how I can use swift-test-codecov in my pre-commit hook to ensure my test code coverage is fulfilled. Feel free to look at how I do this with MistKit and code coverage. I'm going to look at Thanks for the pointers! |
Nice. That would be a great tool, for sure. It might require some good amount of refactoring, to separate the documentation extraction logic from the markdown generation (right now it's all tangled together 🙈). If you want to look into it, I would recommend starting by adding a new command, then running the SourceKitten calls to parse the source files and load documentation. Feel free to duplicate any code, if you want to go this route, we can tidy it up later. |
I posted #65 |
Will take a look, thanks |
Cool! Let me know if you have any questions. |
Hi @leogdion, just left you a comment on the PR. please try pulling the latest changes from the If you don't mind, and have the time, it would be nice to clean up the command, specially all the parameters (arguments) not being used or needed for this command. Instead, you can pass default values to the documentation generator. |
I know some documentation tools have the ability to return the percentage documented. I'd love something like this to include in my CI along with SourceDocs. I am more than willing to help as well and add this feature. Where would something like this be calculated and added?
The text was updated successfully, but these errors were encountered: