Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make --workers option not experimental #1069

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ Options:
# Default: true
[--exported-gem-rbis], [--no-exported-gem-rbis] # Include RBIs found in the `rbi/` directory of the gem
# Default: true
-w, [--workers=N] # EXPERIMENTAL: Number of parallel workers to use when generating RBIs
# Default: 1
-w, [--workers=N] # Number of parallel workers to use when generating RBIs (default: auto)
[--auto-strictness], [--no-auto-strictness] # Autocorrect strictness in gem RBIs in case of conflict with the DSL RBIs
# Default: true
--dsl-dir, [--dsl-dir=directory] # The DSL directory used to correct gems strictnesses
Expand Down Expand Up @@ -442,8 +441,7 @@ Options:
[--exclude=compiler [compiler ...]] # Exclude supplied DSL compiler(s)
[--verify], [--no-verify] # Verifies RBIs are up-to-date
-q, [--quiet], [--no-quiet] # Suppresses file creation output
-w, [--workers=N] # EXPERIMENTAL: Number of parallel workers to use when generating RBIs
# Default: 1
-w, [--workers=N] # Number of parallel workers to use when generating RBIs (default: auto)
[--rbi-max-line-length=N] # Set the max line length of generated RBIs. Signatures longer than the max line length will be wrapped
# Default: 120
-e, [--environment=ENVIRONMENT] # The Rack/Rails environment to use when generating RBIs
Expand Down Expand Up @@ -742,8 +740,7 @@ Options:
# Default: sorbet/rbi/todo.rbi
[--payload], [--no-payload] # Check shims against Sorbet's payload
# Default: true
-w, [--workers=N] # EXPERIMENTAL: Number of parallel workers
# Default: 1
-w, [--workers=N] # Number of parallel workers (default: auto)
-c, [--config=<config file path>] # Path to the Tapioca configuration file
# Default: sorbet/tapioca/config.yml
-V, [--verbose], [--no-verbose] # Verbose output for debugging purposes
Expand Down
22 changes: 3 additions & 19 deletions lib/tapioca/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def todo
option :workers,
aliases: ["-w"],
type: :numeric,
desc: "EXPERIMENTAL: Number of parallel workers to use when generating RBIs",
default: 1
desc: "Number of parallel workers to use when generating RBIs (default: auto)"
option :rbi_max_line_length,
type: :numeric,
desc: "Set the max line length of generated RBIs. Signatures longer than the max line length will be wrapped",
Expand Down Expand Up @@ -134,13 +133,6 @@ def dsl(*constants)
rbi_formatter: rbi_formatter(options)
)

if options[:workers] != 1
say(
"Using more than one worker is experimental and might produce results that are not deterministic",
:red
)
end

Tapioca.silence_warnings do
command.execute
end
Expand Down Expand Up @@ -201,8 +193,7 @@ def dsl(*constants)
option :workers,
aliases: ["-w"],
type: :numeric,
desc: "EXPERIMENTAL: Number of parallel workers to use when generating RBIs",
default: 1
desc: "Number of parallel workers to use when generating RBIs (default: auto)"
option :auto_strictness,
type: :boolean,
desc: "Autocorrect strictness in gem RBIs in case of conflict with the DSL RBIs",
Expand Down Expand Up @@ -252,13 +243,6 @@ def gem(*gems)
raise MalformattedArgumentError, "Option '--verify' must be provided without any other arguments" if verify
end

if options[:workers] != 1
say(
"Using more than one worker is experimental and might produce results that are not deterministic",
:red
)
end

if gems.empty? && !all
command.sync(should_verify: verify, exclude: options[:exclude])
else
Expand All @@ -275,7 +259,7 @@ def gem(*gems)
option :annotations_rbi_dir, type: :string, desc: "Path to annotations RBIs", default: DEFAULT_ANNOTATIONS_DIR
option :todo_rbi_file, type: :string, desc: "Path to the generated todo RBI file", default: DEFAULT_TODO_FILE
option :payload, type: :boolean, desc: "Check shims against Sorbet's payload", default: true
option :workers, aliases: ["-w"], type: :numeric, desc: "EXPERIMENTAL: Number of parallel workers", default: 1
option :workers, aliases: ["-w"], type: :numeric, desc: "Number of parallel workers (default: auto)"
def check_shims
command = Commands::CheckShims.new(
gem_rbi_dir: options[:gem_rbi_dir],
Expand Down
2 changes: 2 additions & 0 deletions spec/helpers/mock_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def tapioca(command)
exec_command << "--workers=1" unless command.match?("--workers")
exec_command << "--no-doc" unless command.match?("--doc")
exec_command << "--no-loc" unless command.match?("--loc")
elsif command.start_with?(/dsl/)
exec_command << "--workers=1" unless command.match?("--workers")
end
bundle_exec(exec_command.join(" "))
end
Expand Down