lib/tapioca/cli.rb in tapioca-0.9.3 vs lib/tapioca/cli.rb in tapioca-0.9.4
- old
+ new
@@ -188,10 +188,14 @@
default: false
option :doc,
type: :boolean,
desc: "Include YARD documentation from sources when generating RBIs. Warning: this might be slow",
default: true
+ option :loc,
+ type: :boolean,
+ desc: "Include comments with source location when generating RBIs",
+ default: true
option :exported_gem_rbis,
type: :boolean,
desc: "Include RBIs found in the `rbi/` directory of the gem",
default: true
option :workers,
@@ -231,10 +235,11 @@
postrequire: options[:postrequire],
typed_overrides: options[:typed_overrides],
outpath: Pathname.new(options[:outdir]),
file_header: options[:file_header],
include_doc: options[:doc],
+ include_loc: options[:loc],
include_exported_rbis: options[:exported_gem_rbis],
number_of_workers: options[:workers],
auto_strictness: options[:auto_strictness],
dsl_dir: options[:dsl_dir],
rbi_formatter: rbi_formatter(options)
@@ -253,11 +258,11 @@
:red
)
end
if gems.empty? && !all
- command.sync(should_verify: verify)
+ command.sync(should_verify: verify, exclude: options[:exclude])
else
command.execute
end
end
end
@@ -268,18 +273,22 @@
option :dsl_rbi_dir, type: :string, desc: "Path to DSL RBIs", default: DEFAULT_DSL_DIR
option :shim_rbi_dir, type: :string, desc: "Path to shim RBIs", default: DEFAULT_SHIM_DIR
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
def check_shims
+ Tapioca.disable_traces
+
command = Commands::CheckShims.new(
gem_rbi_dir: options[:gem_rbi_dir],
dsl_rbi_dir: options[:dsl_rbi_dir],
shim_rbi_dir: options[:shim_rbi_dir],
annotations_rbi_dir: options[:annotations_rbi_dir],
todo_rbi_file: options[:todo_rbi_file],
- payload: options[:payload]
+ payload: options[:payload],
+ number_of_workers: options[:workers]
)
command.execute
end
desc "annotations", "Pull gem RBI annotations from remote sources"
@@ -294,11 +303,10 @@
banner: "gem:level [gem:level ...]",
desc: "Override for typed sigils for pulled annotations",
default: {}
def annotations
if !options[:netrc] && options[:netrc_file]
- say_error("Options `--no-netrc` and `--netrc-file` can't be used together", :bold, :red)
- exit(1)
+ raise Thor::Error, set_color("Options `--no-netrc` and `--netrc-file` can't be used together", :bold, :red)
end
command = Commands::Annotations.new(
central_repo_root_uris: options[:sources],
auth: options[:auth],