Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RBI::Formatter #808

Merged
merged 5 commits into from
Feb 11, 2022
Merged

Use RBI::Formatter #808

merged 5 commits into from
Feb 11, 2022

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Feb 10, 2022

Motivation

Centralize the RBI formatting/printing options under a single class so it's easier to control the generated RBI from command line.

This PR adds an example with --rbi-max-line-length to enforce wrapping for long signatures (see generated gem RBIs for example).

Implementation

We create our own subclass of RBI::Formatter to hold the default behaviour and the methods used to change the content of the generated RBI such as write_header! and write_empty_body_comments.

Tests

See automated tests.

Please skip the two first commits as they belong to #807.

@Morriar Morriar requested a review from a team February 10, 2022 18:59
@Morriar Morriar self-assigned this Feb 10, 2022
lib/tapioca/cli.rb Outdated Show resolved Hide resolved
lib/tapioca/cli.rb Outdated Show resolved Hide resolved
@Morriar Morriar merged commit 612ae60 into main Feb 11, 2022
@Morriar Morriar deleted the at-rbi-formatter branch February 11, 2022 18:11
@shopify-shipit shopify-shipit bot temporarily deployed to production February 17, 2022 22:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants