https://github.com/dduugg/yard-sorbet
Types are documentation
https://github.com/dduugg/yard-sorbet
rbi ruby sorbet yard yardoc
Last synced: about 1 year ago
JSON representation
Types are documentation
- Host: GitHub
- URL: https://github.com/dduugg/yard-sorbet
- Owner: dduugg
- License: apache-2.0
- Created: 2020-01-02T04:02:19.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T10:23:49.000Z (about 1 year ago)
- Last Synced: 2025-04-04T00:09:55.864Z (about 1 year ago)
- Topics: rbi, ruby, sorbet, yard, yardoc
- Language: Ruby
- Homepage:
- Size: 6.76 MB
- Stars: 34
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# yard-sorbet
[](https://badge.fury.io/rb/yard-sorbet)
[](https://github.com/dduugg/yard-sorbet/actions/workflows/ruby.yml)
[](https://codecov.io/gh/dduugg/yard-sorbet)
A YARD [plugin](https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support) that parses Sorbet type annotations
## Features
- Attaches existing documentation to methods and attributes that follow `sig` declarations. (This information is otherwise discarded.)
- Translates `sig` type signatures into corresponding YARD tags
- Generates method definitions from `T::Struct` fields
- Generates constant definitions from `T::Enum` enums
- Modules marked `abstract!` or `interface!` are tagged `@abstract`
- Modules using `mixes_in_class_methods` will attach class methods
- Merges `sig`s in rbi files with source code documentation (rbi files must come after source code in yard configuration)
## Usage
See the Plugin Support [section](https://rubydoc.info/gems/yard/file/docs/GettingStarted.md#plugin-support) of the YARD docs.
## Used By
This plugin is used by:
- The [Homebrew Ruby API](https://rubydoc.brew.sh/index.html)
- [Tapioca](https://github.com/Shopify/tapioca), to optionally include YARD documentation from sources when generating RBIs
- `yard-sorbet` [itself](https://dduugg.github.io/yard-sorbet/)