Created
July 3, 2026 04:06
-
-
Save wilsonsilva/96a74965b3268d552260b47e5d2f2794 to your computer and use it in GitHub Desktop.
rake yard:strict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :yard do | |
| desc "Generate YARD docs and fail unless every object (incl. private) is documented" | |
| task strict: :yard do | |
| require "open3" | |
| out, = Open3.capture2("yard", "stats", "--list-undoc", "--private", "--protected") | |
| puts out | |
| coverage = out[/([\d.]+)% documented/, 1]&.to_f | |
| abort "yard:strict could not parse coverage from `yard stats` output" if coverage.nil? | |
| abort "yard:strict failed: #{coverage}% documented (< 100%)" if coverage < 100.0 | |
| end | |
| end | |
| rescue LoadError | |
| # YARD is a development dependency; its tasks are simply unavailable without it. | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment