RuboCop – Ruby static code analyzer and formatter

RuboCop is a Ruby static code analyzer and formatter based around conventions from the community Ruby Style Guide. It checks source code for style, layout and programming issues while also providing formatting and automatic correction facilities.

The tool is highly configurable, making it suitable for projects that want to follow RuboCop’s defaults as well as teams with their own established coding conventions. Its large ecosystem of extensions also allows specialised checks to be added for frameworks, testing tools and other areas of Ruby development.

This is free and open source software.

Key Features

  • Checks Ruby code using an extensive collection of cops covering layout, linting, naming, metrics, security, style and other categories.
  • Automatically corrects many detected offences, with a distinction between safe and potentially unsafe corrections.
  • Includes code-formatting functionality as part of the same analysis workflow.
  • Provides a built-in Language Server Protocol server for editor and IDE integration.
  • Offers extensive project configuration, including per-file settings and the ability to disable individual cops for selected parts of source files.
  • Can inspect only files changed in Git, which is useful when introducing checks to large or established repositories.
  • Can preview autocorrections as a diff without modifying source files.
  • Supports multiple reporting formats, including output designed for terminals, automated tooling and SARIF-compatible code scanning systems.
  • Can be extended with custom cops and formatters and has a substantial ecosystem of extensions for Rails, RSpec, performance analysis and other Ruby tooling.
  • Supports the major Ruby implementations and integrates with a wide selection of editors and development environments.

Website: github.com/rubocop/rubocop
Support:
Developer: Bozhidar Batsov
License: MIT License

RuboCop is written in Ruby. Learn Ruby with our recommended free books and free tutorials.


Related Software

Ruby Linters
RuboCopRuby static code analyzer and formatter
ReekExamines Ruby classes, modules, and methods
Standard RubyProvides an opinionated, unconfigurable ruleset
HAML-LintRuby-based linter for HAML templates
Slim-LintConfigurable tool for analyzing Slim templates
ERB LintLint your ERB or HTML files
YARD-LintFor Ruby and Ruby on Rails projects that lint YARD documentation
oxicopFast Ruby linter

Read our verdict in the software roundup.

Ruby Code Formatters
RuboCopChecks style, detects potential problems, and autocorrects offences
Standard RubyCombines linting and automatic fixes with a shared set of rules
rubyfmtApplies a consistent style with minimal configuration required
Syntax TreeToolkit for parsing, inspecting, and transforming source files
RufoKeeps source files tidy with an opinionated approach to style
alofmtDelivers fast, deterministic formatting for consistent results

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted