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

[Proposal] Introduce rubocop-on-rbs #601

Open
ksss opened this issue Jun 12, 2024 · 0 comments
Open

[Proposal] Introduce rubocop-on-rbs #601

ksss opened this issue Jun 12, 2024 · 0 comments

Comments

@ksss
Copy link
Collaborator

ksss commented Jun 12, 2024

I propose introducing rubocop-on-rbs to perform static analysis on RBS.

I believe that by introducing this gem, we can aim to raise the quality of RBS.

RuboCop on RBS

RuboCop is one of the most popular static analysis tools for Ruby.
rubocop-on-rbs is an extension of RuboCop that enables style checks for RBS files.

Scope

The scope of this issue is RBS files only.

Automatic feedback

Use github formatter of RuboCop on GitHub Action.

$ rubocop --format github

Since feedback is displayed on the code in the PR, we can quickly notice and address the issues.

スクリーンショット 2024-06-12 16 17 50

Since it is confined to GitHub Actions, it is also secure.

Static check only

Since we are only performing static analysis on RuboCop, there are no security issues as long as we trust the code of rubocop and rubocop-on-rbs.

Different settings for each gem

In RuboCop, placing a .rubocop.yml file in a subdirectory allows you to override the settings for that directory and its subdirectories.

By utilizing this mechanism, we can change the settings for each gem individually.

https://docs.rubocop.org/rubocop/configuration.html

On local checking

RuboCop is easy to run in a local environment, making it simple for us to verify fixes.

Features

rubocop-on-rbs provides documentation for each feature. Please take a look at it here.

https://github.com/ksss/rubocop-on-rbs/blob/main/docs/modules/ROOT/pages/cops.adoc

Introduction Steps

At first, I am considering applying the RBS/Layout and RBS/Lint features.
Since some of the RBS/Style features can be quite opinionated, I plan to introduce them later after consulting with the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant