Announcing YARD-Lint: Keep Your Ruby Documentation Solid

62 days ago 14 views Closer to Code mensfeld.pl

TL;DR: YARD-Lint catches documentation issues, just like RuboCop for code. Star it and use it now.

I am happy to announce the release of YARD-Lint, a comprehensive linter designed for YARD documentation in Ruby and Rails projects. This gem is now available as open-source.

In your Gemfile gem 'yard-lint'

In your Gemfile gem 'yard-lint'

For those who are not familiar, YARD (Yet Another Ruby Documentation) is a documentation tool for Ruby that employs structured tags like @param, @return, @raise, and @example to describe methods with precision that machines can read.

@param

@return

@raise

@example

Here's an example of linting in practice:

Reverses the contents of a String or IO object. # # @param content [String, #read] the contents to reverse # @return [String] the contents reversed lexically # @example # reverse("testing" #=> "gnitset" def reverse(contents) contents = contents.read if contents.respond_to? :read contents.reverse end

Reverses the contents of a String or IO object. # # @param content [String, #read] the contents to reverse # @return [String] the contents reversed lexically # @example # reverse("testing" #=> "gnitset" def reverse(contents) contents