You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running standardrb on the CLI, I expect that any args not recognized by standard will be forwarded to the rubocop invocation. This does not seem to happen with --server.
Expectation
Subsequent invocations of standardrb should run much faster when the rubocop server has been launched after the first invocation.
Example
❯ time bundle exec standardrb --fix --server '/Users/georges/development/.../config/initializers/http_defaults.rb'
Inspecting 1 file
.
1 file inspected, no offenses detected
bundle exec standardrb --fix --server 2.02s user 0.81s system 91% cpu 3.086 total
❯ time bundle exec standardrb --fix --server '/Users/georges/development/.../config/initializers/http_defaults.rb'
Inspecting 1 file
.
1 file inspected, no offenses detected
bundle exec standardrb --fix --server 1.85s user 0.75s system 95% cpu 2.714 total
Full file path intentionally omitted above.
As you can see, there is no appreciable speedup seen when passing the --server option.
In addition, the rubocop server has not been launched.
Howdy. I spent ten minutes looking into this (I'd never heard of the --server feature in Rubocop before.
This should be achievable, but I don't think I'm going to make the time to do this myself.
Some breadcrumbs if you or someone else wants to take a stab at a PR:
Some nomenclature: RuboCop's CLI has "options" (command-line args / env vars), including --server, --server-status, --start-server, --stop-server as well as "configuration" (the config file of cops and settings). These are both handed to a Runner, which in RuboCop are factored as "Commands". You can see the server commands here
Standard imitates the shape of this runner style by invoking RuboCop's primary Runner (in most cases) and implementing our own (when someone adds --version etc). These live in lib/runners
I believe a PR could implement this behavior of either forking or forwarding to RuboCop's server commands from a new Standard set of commands. Because the server is doing stuff, there's a chance we'd need to fork or patch whatever the RuboCop server is invoking, in turn, though, so it's not really clear it'd work.
Thanks for that background @searls, very appreciated.
I'll leave this issue here for anyone else wondering. It seems like a good implementation requires someone to get into the internals of both projects.
In the meantime, an interim way to go would be using Rubocop directly with Standard's set of cops.
Issue
When running standardrb on the CLI, I expect that any args not recognized by standard will be forwarded to the rubocop invocation. This does not seem to happen with
--server
.Expectation
Subsequent invocations of standardrb should run much faster when the rubocop server has been launched after the first invocation.
Example
Full file path intentionally omitted above.
As you can see, there is no appreciable speedup seen when passing the
--server
option.In addition, the rubocop server has not been launched.
The text was updated successfully, but these errors were encountered: