Standard Ruby wraps RuboCop with a fixed ruleset and the standardrb CLI, offering auto-fixes, editor LSP support, and optional plugins.
Overview
Standard Ruby is a linter and formatter for Ruby modeled after the StandardJS idea: one shared configuration instead of endless team debates over style rules. It builds on RuboCop and rubocop-performance, ships a curated ruleset the community has argued over since 2018, and updates that ruleset on a monthly release cadence so upgrades stay manageable.
Run it with the standardrb executable or a Rake task after adding the gem. It scans Ruby files under the current directory tree, reports violations, and exits quietly on success. Most issues can be auto-fixed safely; additional unsafe fixes are available when you accept behavioral risk. Line, block, file, and todo-based ignores let large codebases adopt Standard incrementally without blocking the build.
Editor guides cover Atom, neovim, vim, VS Code, and Sublime Text. Language server support comes both as a Ruby LSP add-on and an internal server via standardrb --lsp, providing diagnostics and formatting in compatible editors. CI systems can run the same CLI without extra plugins.
Although core RuboCop rules are not user-tunable, Standard exposes CLI flags and .standard.yml for paths, ruby version targets, plugins such as standard-rails or standard-sorbet, and extended RuboCop config files through lintroller-based plugins.
Key features
- Fixed RuboCop-derived ruleset
- standardrb CLI and Rake task
- Safe and unsafe auto-fix modes
- Line and file ignore directives
- Incremental todo adoption workflow
- Ruby LSP and internal LSP server
- Plugin and extend_config support
- Monthly ruleset maintenance
Use cases
- Standardize Ruby formatting across teams
- Run lint in CI without custom RuboCop configs
- Format Ruby inside VS Code or vim
- Gradually fix legacy Ruby codebases
- Add Rails- or Sorbet-specific lint rules