Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rubocop-rbs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubocop-rbs

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RuboCop RBS

Gem Version

RucoCop extension that check RBS signatures.

DISCLAIMER: this extension is an ALPHA version, it could be not 100% stable

Check for:

  • invalid RBS files;
  • missing RBS method signatures;
  • mismatching RBS method signatures arguments.

Please ⭐ if you like it.

Know limitations: some IDEs don't update the RBS cops offenses in real-time when a change is applied because only the .rb files are actively monitored.

Install

  • Add to Gemfile: gem 'rubocop-rbs', '~> 0.1.1' (and execute bundle);
  • Add to .rubocop.yml:
require:
  - rubocop-rbs

Usage

  • Execute rubocop: bundle exec rubocop
  • To skip the cop from some files:
Rbs/MethodSignature:
  Exclude:
    - main.rb

Offenses

  • Rbs/MethodSignature: signature error: one or more signature errors in a RBS file:
main.rb:7:3: C: Rbs/MethodSignature: signature error, sig/main.rbs:1:0...1:3: Syntax error: cannot start a declaration, token=def (kDEF)
  def test_required_positionals(key1, key2); end
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Rbs/MethodSignature: missing signature: method signature not found in the RBS files:
main.rb:7:3: C: Rbs/MethodSignature: missing signature
  def test_required_positionals(key1, key2); end
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Rbs/MethodSignature: signature mismatch: method signature has different arguments from the one defined in the RBS files:
main.rb:7:3: C: Rbs/MethodSignature: signature mismatch, expected: (untyped, untyped, untyped) -> void
  def test_required_positionals(key1, key2); end
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Do you like it? Star it!

If you use this component just star it. A developer is more motivated to improve a project when there is some interest.

Or consider offering me a coffee, it's a small thing but it is greatly appreciated: about me.

Contributors

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 05 Jul 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc