Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dduugg/yard-sorbet
Types are documentation
https://github.com/dduugg/yard-sorbet
rbi ruby sorbet yard yardoc
Last synced: 5 days 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 (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T10:55:50.000Z (21 days ago)
- Last Synced: 2024-12-11T05:03:52.379Z (12 days ago)
- Topics: rbi, ruby, sorbet, yard, yardoc
- Language: Ruby
- Homepage:
- Size: 5.52 MB
- Stars: 32
- Watchers: 3
- Forks: 9
- 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
[![Gem Version](https://badge.fury.io/rb/yard-sorbet.svg)](https://badge.fury.io/rb/yard-sorbet)
[![Build Status](https://github.com/dduugg/yard-sorbet/actions/workflows/ruby.yml/badge.svg)](https://github.com/dduugg/yard-sorbet/actions/workflows/ruby.yml)
[![codecov](https://codecov.io/gh/dduugg/yard-sorbet/branch/master/graph/badge.svg)](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/)