← All posts

Release: DeepSource Ruby analyzer is now in GA

DeepSource Ruby analyzer lands in GA, with over 260 issues, Autofix & Transformers.

Header image
By Ravi Teja Gannavarapu on 
Share on Twitter Share on LinkedIn Share on Facebook

Today, we are excited to announce that the DeepSource Ruby analyzer is out of beta. Apart from increased stability, the analyzer now detects over 260 issues, from around 170 when it was released in beta.

And the best part, you can use DeepSource to fix over 70 different issues automatically using Autofix, or to transform your whole codebase using Transformers.

Using the Ruby analyzer

To start analyzing your Ruby code, just enable the ruby analyzer in your .deepsource.toml file, and you are good to go.

Sample configuration

version = 1

test_patterns = [
  "test/**",
  "*_test.rb"
]

exclude_patterns = [
  "vendor/**",
  "**/examples/**"
]

[[analyzers]]
name = "ruby"
enabled = true

Fixing your code using Autofix

Over 70 issues can be autofixed using the DeepSource Ruby Autofix. Look for the Autofix badge in the Issues tab.

Transforming your code using Transformers

You can also use the available Ruby Transformers to automatically transform your codebase. We currently support both StandardRB and RuboCop.

Sample configuration to use both Ruby analyzers & Transformers

version = 1

test_patterns = [
  "test/**",
  "*_test.rb"
]

exclude_patterns = [
  "vendor/**",
  "**/examples/**"
]

[[analyzers]]
name = "ruby"
enabled = true

[[transformers]]
name = "standardrb"
enabled = true

Issues detected by the Ruby analyzer

We currently support over 260 issues in your Ruby code, across categories like bug risks, anti-patterns, security vulnerabilities, and style issues. Here’s some of them to give you an idea:

Bug risks:

  • Bad ordering of magic comments
  • while/until detected in begin block
  • Invalid construction of percent string literal

Security issues:

  • Use of eval detected
  • Insecure JSON method detected
  • Use of insecure YAML method detected

Antipatterns:

  • Use each_with_object instead of inject/reduce
  • Check for Bignum or Fixnum detected
  • if/elsif/unless branches without a body detected

We’re very excited about this release, and hope that this will help you avoid many issues in your code, and make writing Ruby even more fun! Head over to the docs or tell us what you think!

About DeepSource
DeepSource helps you automatically find and fix issues in your code during code reviews, such as bug risks, anti-patterns, performance issues, and security flaws. It takes less than 5 minutes to set up with your Bitbucket, GitHub, or GitLab account. It works for Python, Go, Ruby, and JavaScript.
Get started for free

Keep reading...