dev-cmd/typecheck: Make an --update switch for automatic updates
- This was suggested in https://github.com/Homebrew/brew/pull/8741#discussion_r490949486.
This commit is contained in:
parent
d9416d762a
commit
bb0fc2764e
@ -16,10 +16,8 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
switch "-q", "--quiet",
|
switch "-q", "--quiet",
|
||||||
description: "Silence all non-critical errors."
|
description: "Silence all non-critical errors."
|
||||||
switch "--update-definitions",
|
switch "--update",
|
||||||
description: "Update Tapioca gem definitions of recently bumped gems"
|
description: "Update RBI files and prune #{SORBET_FILES_YAML}"
|
||||||
switch "--prune-files-list",
|
|
||||||
description: "Remove deleted filepaths from #{SORBET_FILES_YAML}"
|
|
||||||
switch "--fail-if-not-changed",
|
switch "--fail-if-not-changed",
|
||||||
description: "Return a failing status code if all gems are up to date " \
|
description: "Return a failing status code if all gems are up to date " \
|
||||||
"and gem definitions do not need a tapioca update"
|
"and gem definitions do not need a tapioca update"
|
||||||
@ -41,7 +39,8 @@ module Homebrew
|
|||||||
Homebrew.install_bundler_gems!
|
Homebrew.install_bundler_gems!
|
||||||
|
|
||||||
HOMEBREW_LIBRARY_PATH.cd do
|
HOMEBREW_LIBRARY_PATH.cd do
|
||||||
if args.prune_files_list?
|
if args.update?
|
||||||
|
ohai "Checking for deleted filenames in #{SORBET_FILES_YAML}..."
|
||||||
lines_to_keep = []
|
lines_to_keep = []
|
||||||
sorbet_keywords = ["true:", "false:", "strict:", "strong:"]
|
sorbet_keywords = ["true:", "false:", "strict:", "strong:"]
|
||||||
|
|
||||||
@ -52,12 +51,11 @@ module Homebrew
|
|||||||
filepath = line.split(" ").last
|
filepath = line.split(" ").last
|
||||||
lines_to_keep << line if File.exist?(filepath)
|
lines_to_keep << line if File.exist?(filepath)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
File.write(SORBET_FILES_YAML, "#{lines_to_keep.join("\n")}\n")
|
File.write(SORBET_FILES_YAML, "#{lines_to_keep.join("\n")}\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
if args.update_definitions?
|
ohai "Updating Tapioca RBI files..."
|
||||||
system "bundle", "exec", "tapioca", "sync"
|
system "bundle", "exec", "tapioca", "sync"
|
||||||
system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
||||||
system "bundle", "exec", "srb", "rbi", "todo"
|
system "bundle", "exec", "srb", "rbi", "todo"
|
||||||
|
|||||||
@ -1244,10 +1244,8 @@ Check for typechecking errors using Sorbet.
|
|||||||
|
|
||||||
* `-q`, `--quiet`:
|
* `-q`, `--quiet`:
|
||||||
Silence all non-critical errors.
|
Silence all non-critical errors.
|
||||||
* `--update-definitions`:
|
* `--update`:
|
||||||
Update Tapioca gem definitions of recently bumped gems
|
Update RBI files and prune sorbet/files.yaml
|
||||||
* `--prune-files-list`:
|
|
||||||
Remove deleted filepaths from sorbet/files.yaml
|
|
||||||
* `--fail-if-not-changed`:
|
* `--fail-if-not-changed`:
|
||||||
Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update
|
Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update
|
||||||
* `--dir`:
|
* `--dir`:
|
||||||
|
|||||||
@ -1718,12 +1718,8 @@ Check for typechecking errors using Sorbet\.
|
|||||||
Silence all non\-critical errors\.
|
Silence all non\-critical errors\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-update\-definitions\fR
|
\fB\-\-update\fR
|
||||||
Update Tapioca gem definitions of recently bumped gems
|
Update RBI files and prune sorbet/files\.yaml
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-\-prune\-files\-list\fR
|
|
||||||
Remove deleted filepaths from sorbet/files\.yaml
|
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-fail\-if\-not\-changed\fR
|
\fB\-\-fail\-if\-not\-changed\fR
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user