Skip to content

A tool to help analyze and add godoc comments to undocumented go functions

License

Notifications You must be signed in to change notification settings

frankstratton/docdr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocDr

DocDr (Doc Doctor) is a simple tool for scaning a Golang codebase looking for functions without godoc comments. DocDr presents an interface to quickly add comments and rewrites your source files.

Install & Usage

⚠️ This project is considered an alpha; it may have unintented side effects; always backup your work before running

Install

go get github.com/frankstratton/docdr

Running

Analyze a source directory and print a coverage report for documented functions

docdr run <source directory>

Parse a package for undocumented functions and prompt for comments

docdr run <source directory> <package name>

Features

TODO

  • Add a subcommand to select the 'best' function for comments via some heuristic measure; e.g. -- least covered package + longest function
  • Add interactive commands:
    • n: Never ask again; add a default doc string so we always skip this function
    • x: Exit and write any pending changes (currently if you are using [e] it only calls writeFile when you've finished all comments in the current file. We should also maybe catch ctrl-c and write pending changes or prompt to discard
  • Fix offsets when editing the original file. Currently we don't rescan/reload Positions so if you add comments to one function, the next edit in the same file opens to the wrong line.
  • Other editor support as necessary
  • Termbox/Tcell/Other better UI for terminal only use

About

A tool to help analyze and add godoc comments to undocumented go functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages