godoc-lint – linter for consistent Go documentation

godoc-lint is a linter for Go documentation comments.

It is aimed especially at reusable modules, SDKs, API clients and libraries where consistent documentation affects both IDE assistance and the rendered documentation on pkg.go.dev. The tool applies a configurable set of rules derived from established Go documentation conventions while keeping a practical default configuration for projects that want useful checks without extensive setup. This makes it particularly useful for codebases exposing public APIs where documentation consistency forms part of the developer experience.

This is free and open source software.

Key Features

  • Checks that package documentation begins with the expected Package name form.
  • Can require packages to contain documentation and enforce a single package documentation comment.
  • Checks that documentation for declarations begins with the corresponding symbol name.
  • Can require documentation for exported symbols and, optionally, unexported symbols.
  • Validates the conventional formatting of deprecation notices.
  • Can limit documentation line length while ignoring appropriate preformatted sections and link definitions.
  • Detects documentation link definitions that are never referenced.
  • Can suggest standard-library identifiers that should use Go documentation links.
  • Allows individual rules to be enabled or disabled through configuration.
  • Supports path inclusion and exclusion patterns for controlling which source files are analysed.
  • Provides inline directives for suppressing selected rules around individual declarations or across an entire file.
  • Can skip test files or include them depending on the configured policy.
  • Works as a standalone command and is also available through Golangci-lint.
  • Uses sensible defaults when no project configuration file is present.

Website: github.com/godoc-lint/godoc-lint
Support:
Developer: godoc-lint
License: MIT License

godoc-lint is written in Go. Learn Go with our recommended free books and free tutorials.


Related Software

Go Linters
reviveDesigned as a drop-in replacement for golint
golangci-lintFast Go linters runner
gosecSecurity scanner for Go projects
StaticcheckAdvanced Go linter
go-criticOpinionated Go source code linter
VetExamines Go source code and reports suspicious constructs
gofumptStricter gofmt
gofmtFormats Go programs
go-ruleguardAnalysis-based Go linter that runs dynamically loaded rules
forbidigoGo linter for forbidding identifiers
godotKeep source code comments consistent

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted