talira

Standard Ruby

Unconfigurable Ruby linter and formatter built on RuboCop

open sourceMITfree

Standard Ruby (the standard gem) brings StandardJS's approach to Ruby: a linter and formatter built on RuboCop with one fixed configuration of RuboCop's built-in rules and rubocop-performance's, so a team stops arguing about style. It fixes what it can automatically, runs in editors and CI, includes a language server (standardrb --lsp) and a Ruby LSP add-on, and supports plugins built with lint_roller such as standard-rails and standard-sorbet. Test Double maintains it and updates its rules each month as RuboCop adds new ones.

Problems it solves

  • stop my team arguing about Ruby style rules in code review
  • lint and auto-format a Ruby project without writing a RuboCop config
  • get the same Ruby formatting in every editor and in CI

Features

  • one fixed configuration of RuboCop's and rubocop-performance's rules
  • automatic fixes
  • language server (standardrb --lsp) and a Ruby LSP add-on
  • plugins built with lint_roller, such as standard-rails and standard-sorbet
  • editor and CI integrations

Limitations

  • Its rule set can't be configured: you use Standard's rules as they are or not at all.1

Alternatives

The same job

These do what Standard Ruby does.

  1. RuboCop A Ruby static code analyzer and formatter, based on the community Ruby style guide.
  2. RuboCop Rails RuboCop extension with cops for Rails best practices and conventions
  3. RuboCop Rake RuboCop plugin with cops for Rake task files
  4. RuboCop RSpec RuboCop extension with cops for RSpec test files
  5. rubocop-require_tools RuboCop extension that flags missing require statements
  6. RuboCop Performance Performance optimization analysis for Ruby code, as a RuboCop extension

Compare Standard Ruby with the top 3