Socket
Book a DemoInstallSign in
Socket

rubocop-crystal

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubocop-crystal

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

Rubocop::Crystal

The beginnings of a RuboCop extension for converting Ruby to Crystal.

TODO

Many things. In particular, how are types going to work?

Getting static type information about Ruby files isn't the difficult part, the problem is conveying this information to the Crystal compiler while still maintaining valid syntax.

Inserting Crystal types into Ruby code is a no-go, because that causes Lint/Syntax errors in RuboCop.

Possible paths foward:

  • Modify the parser to accept Crystal type declarations, or at least not break on them.
  • Modify Crystal to accept type declarations from .rbs and/or .rbi files.
  • Modify Crystal to accept type declarations from sorbet/rbs-inline/other annotations.
    • Write Ameba extension to convert the type annotations, as it works with Crystal syntax.
  • Find a way to convey type information to Crystal using valid Ruby syntax.

Interesting repos:

Installation

gem install rubocop-crystal

Usage

rubocop --plugin rubocop-crystal

Note that there are some differences between Ruby and Crystal that can be automatically resolved, while some (at least for now) require manual intervention.

If you wish to only process the autocorrectable offenses, add --disable-uncorrectable, while reporting only the offenses requiring manual intervention is waiting on rubocop/rubocop#13275.

FAQs

Package last updated on 28 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.