Skip to content

Allow RBS inline annotation - #709

Merged
camilopayan merged 1 commit into
standardrb:mainfrom
smortex:allow-rbs-inline-annotation
Jun 11, 2025
Merged

Allow RBS inline annotation#709
camilopayan merged 1 commit into
standardrb:mainfrom
smortex:allow-rbs-inline-annotation

Conversation

@smortex

Copy link
Copy Markdown
Contributor

This PR add support for RBS in-line annotations.

It replaces #656 which did that but also updated rubocop and had unrelated
changes. Rubocop was updated to a compatible version with #659, so we just
have to turn on the corresponding option of the rubocop check.

Type signature for Ruby (rbs) allow type checkers (e.g. steep) to
statically check for issues in a code base. Developpers must sometimes
provide hints when initializing a data structure (e.g. an empty Array)
so that the type checker can properly check its usage. These hints are
passed with an in-line comment like so:
```
results = [] #: Array[Integer]
```
Rubocop added support for such comments as on option in its
Layout/LeadingEmptyLines check in version 1.67.0. This gem currently
use a newer version so this option is available but not enabled yet.
Enable this option to make it possible to use both rbs and standard at
the same time.
@smortex
smortex marked this pull request as ready for review April 5, 2025 20:52
@camilopayan
camilopayan merged commit 99d9b4c into standardrb:mainJun 11, 2025
@smortex
smortex deleted the allow-rbs-inline-annotation branch June 11, 2025 22:57
@TonyCTHsuTonyCTHsu mentioned this pull request Jul 9, 2026
TonyCTHsu added a commit to DataDog/dd-trace-rb that referenced this pull request Jul 9, 2026
Filed standardrb/standard#820 to add AllowSteepAnnotation: true to
standard's own base config, following the precedent set by RBS support
in standardrb/standard#709. If merged and released, we can drop our
Layout/LeadingCommentSpace override here.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@smortex@camilopayan@jasonkarns@VikiAnn