rubocop VS solargraph

Compare rubocop vs solargraph and see what are their differences.

rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide. (by rubocop)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
rubocop solargraph
39 16
12,491 1,844
0.3% -
9.8 7.4
6 days ago 2 months ago
Ruby Ruby
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

rubocop

Posts with mentions or reviews of rubocop. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-02.
  • Must-have gems for mature Rails
    8 projects | dev.to | 2 Feb 2024
    gem "rubocop" - https://github.com/rubocop/rubocop | Set up code guidelines for your dev team, I recommend using whatever Standard recommends.
  • I Love Ruby
    12 projects | news.ycombinator.com | 18 Dec 2023
    I believe if you use the `||` operator instead of `or`, then things just work out fine. I agree it is really annoying. But I am pretty sure if you use a tool like RuboCop https://github.com/rubocop/rubocop (a static code analysis tool) then it will catch bugs like this. Note that I am not recommending Ruby. But in my experience if you want to work with a language and it has a community style guide and a linter that enforces it, it will save me some heartache.
  • Mastering Linters : A Code Quality Assurance Comprehensive Guide using Ruby on Rails
    1 project | dev.to | 8 Nov 2023
  • code review / feedback for improvement
    2 projects | /r/ruby | 16 Sep 2023
    Adopt some sort of consistent formatting. Your top-level module starts off indented, seems like wasted space. May I suggest RuboCop?
  • An Introduction to RuboCop for Ruby on Rails
    3 projects | dev.to | 13 Sep 2023
    By default, out of the box, RuboCop comes with a default set of pre-configured rules. The documentation will tell you Rubocop's default rules.
  • I live and work in the US where protests against police brutality have been ongoing for days, and coming to work this week the word "cop" has an uncomfortable feeling about it.
    3 projects | /r/programmingcirclejerk | 7 Jul 2023
  • Code Reviewing a Ruby on Rails application.
    6 projects | dev.to | 3 Jul 2023
    RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide. Apart from reporting the problems discovered in your code, RuboCop can also automatically fix many of them for you.
  • Xeme: I'd value your opinion on my new Ruby gem
    5 projects | /r/ruby | 29 May 2023
    But I will encourage you to adopt Rubocop to enforce the style you want, so that if others want to contribute, they can write with spaces and then run rubocop -a and end up with the styling you prefer. Tabs indentation support was added a couple of years back: https://github.com/rubocop/rubocop/pull/7867
  • Welcome to Rails Cheat Sheet
    3 projects | news.ycombinator.com | 13 May 2023
    In my last job I encountered my first Rails codebase ever (mostly REST APIs but a few server-rendered views as well). After the initial chaotic impression of the codebase (it was a startup after all) with all the Rails magic on top, I really fell in love with the framework after a more experienced Rails dev introduced a few key conventions and helpful libraries to the codebase.

    Out of those, I’d at least add the RuboCop [1] linter and the BetterSpecs [2] guidelines to this list. Both helped tremendously in eliminating bikeshedding in the team and freeing up brainpower to solve actual problems. The first one helped me learn intricacies of Ruby bit by bit right in my IDE and the latter guided us to write tests in a style that’s easy to maintain and trust.

    [1] https://github.com/rubocop/rubocop

    [2] https://www.betterspecs.org/

  • Ruby 2.7.8 Released
    1 project | /r/ruby | 1 Apr 2023
    RuboCop had a setting for this but it was removed for Ruby 3 because there are valid reasons to pass a hash into a method, and linting it might break code. Here is the issue referencing the commits where it was removed, if you ever need to do this again you could just find an earlier commit.

solargraph

Posts with mentions or reviews of solargraph. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-24.
  • A few words on Ruby's type annotations state
    1 project | /r/ruby | 5 May 2023
    My favorite typing solution so far in ruby is Solargraph https://solargraph.org/.
  • Nice Ruby IDEs
    2 projects | /r/ruby | 24 Mar 2023
    Solagraph: https://solargraph.org
  • Using SyntaxSuggest with Solargraph LSP!
    3 projects | /r/ruby | 28 Dec 2022
    Yay! For those who don’t know solargraph provides a language server protocol (LSP) for Ruby so that your IDE (like vscode) can know more about the code you’re writing https://solargraph.org/.
  • Ruby Delights Built into the Language: No Gems Required
    9 projects | news.ycombinator.com | 20 Dec 2022
    If you're looking for IDE-level language assistance, I can't help you, but since you mentioned nvim: I use regular vim with CoC / Conquer of Completion (vim plugin; LSP server, may not strictly be necessary for nvim), Solargraph (Ruby Gem; language server), and Rubocop (also a Gem) for linting. I previously/still use ALE (vim plugin; Asynchronous Lint Engine) because I haven't gotten CoC+Solargraph to play nice with Rubocop, probably due to something silly.

    https://github.com/neoclide/coc.nvim

    https://solargraph.org/

    https://rubocop.org/

    https://github.com/dense-analysis/ale

    My impression with all of this running under MacVim... it's plenty responsive. It can take a while for Solargraph to index everything on startup if you're working in a big project; once it loads, it's snappy. (There's probably a way to cache that startup scan.)

  • I need help with lsp-mode setup
    2 projects | /r/emacs | 17 Nov 2022
    I am trying to use lsp-mode for ruby via solargraph and for Rails era templates using web-mode via lsp-tailwindcss and both seems to kinda sorta work but neither one is really giving me all the features that I see that others have.
  • State of the Ruby language server (LSP) ecosystem / looking for suggestions
    11 projects | /r/ruby | 2 Oct 2022
    https://github.com/castwide/solargraph Seems to be the most mature/developed one. Slow on my system, bad documentation. Language docs are shipped as "cores" you imperatively download that float around in your home directory; this is messy and prone to failure. Doesn't have any docs for versions of ruby past 2.7.
  • Trouble With Solargraph Completions
    1 project | /r/neovim | 29 Sep 2022
    I have recently installed Solargraph and can see that when I open a Ruby file that the LSP is attached to my buffer via `LspInfo`. However whenever I am trying to do some very basic completions or see what kind of methods are available for an object, literally nothing happens. What I am aiming for is something like on the official Solargraph website: https://solargraph.org/
  • Linting and Auto-formatting Ruby Code With RuboCop
    12 projects | dev.to | 29 Jun 2022
    If you use Vim or Neovim, you can display RuboCop's diagnostics through coc.nvim. You need to install the Solargraph language server (gem install solargraph), followed by the coc-solargraph extension (:CocInstall coc-solargraph). Afterwards, configure your coc-settings.json file as shown below:
  • anyone here using neovim for ruby on rails projects?
    10 projects | /r/neovim | 14 Jun 2022
    The builtin LSP works well with solargraph to provide autocompletion.
  • Sorbet: Stripe's Type Checker for Ruby
    6 projects | news.ycombinator.com | 29 Mar 2022
    Sorbet and/or RBS seems like they may be the future given how popular typescript is with JS programmers these days. There are some other projects that assist programmers without relying on formal type definitions in the source or shadow typing files:

    Solargraph combines inference and insight from YARD docs (standard for many gems, plus Castwide has written more YARD for the standard library) to make some pretty good guesses. Crucially it has plugins that add the insights from popular gems with static analysis (e.g. reek, rubocop). I maintain solargraph-rails, which parses your Ruby to make guesses about (surprise) Rails.

    The typeprof gem can help IDE plugins make typing guesses based on your tests. This project is interesting to me because it's going into Ruby 3.1 so I think it reflects awareness from the core ruby team that many programmers are not ready to add types to their code.

    solargraph: https://github.com/castwide/solargraph

What are some alternatives?

When comparing rubocop and solargraph you can also consider the following projects:

sorbet - A fast, powerful type checker designed for Ruby

ruby-lsp - An opinionated language server for Ruby

Rubycritic - A Ruby code quality reporter

coc-solargraph - Solargraph extension for coc.nvim

steep - Static type checker for Ruby

bullet - help to kill N+1 queries and unused eager loading

vscode-ruby - Provides Ruby language and debugging support for Visual Studio Code

Reek - Code smell detector for Ruby

Roda - Routing Tree Web Toolkit

Pronto - Quick automated code review of your changes

TypeORM - ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.