Remove files.yaml for Sorbet.
This commit is contained in:
parent
d5e600e3af
commit
4382ee9d14
5
.github/workflows/sorbet.yml
vendored
5
.github/workflows/sorbet.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Update Sorbet-related files
|
name: Update Sorbet files
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
@ -39,7 +39,8 @@ jobs:
|
|||||||
|
|
||||||
if brew typecheck --update --fail-if-not-changed; then
|
if brew typecheck --update --fail-if-not-changed; then
|
||||||
git add "$GITHUB_WORKSPACE/Library/Homebrew/sorbet"
|
git add "$GITHUB_WORKSPACE/Library/Homebrew/sorbet"
|
||||||
git commit -m "sorbet: Update RBI files and prune files.yaml." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml)."
|
git commit -m "sorbet: Update RBI files." \
|
||||||
|
-m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow."
|
||||||
echo "::set-output name=committed::true"
|
echo "::set-output name=committed::true"
|
||||||
if [ -n "$BRANCH_EXISTS" ]; then
|
if [ -n "$BRANCH_EXISTS" ]; then
|
||||||
echo "::set-output name=pull_request::true"
|
echo "::set-output name=pull_request::true"
|
||||||
|
|||||||
@ -6,8 +6,6 @@ require "cli/parser"
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
SORBET_FILES_YAML = "sorbet/files.yaml"
|
|
||||||
|
|
||||||
def typecheck_args
|
def typecheck_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
usage_banner <<~EOS
|
usage_banner <<~EOS
|
||||||
@ -18,10 +16,10 @@ module Homebrew
|
|||||||
switch "-q", "--quiet",
|
switch "-q", "--quiet",
|
||||||
description: "Silence all non-critical errors."
|
description: "Silence all non-critical errors."
|
||||||
switch "--update",
|
switch "--update",
|
||||||
description: "Update RBI files and prune #{SORBET_FILES_YAML}"
|
description: "Update RBI files."
|
||||||
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."
|
||||||
flag "--dir=",
|
flag "--dir=",
|
||||||
description: "Typecheck all files in a specific directory."
|
description: "Typecheck all files in a specific directory."
|
||||||
flag "--file=",
|
flag "--file=",
|
||||||
@ -41,21 +39,6 @@ module Homebrew
|
|||||||
|
|
||||||
HOMEBREW_LIBRARY_PATH.cd do
|
HOMEBREW_LIBRARY_PATH.cd do
|
||||||
if args.update?
|
if args.update?
|
||||||
ohai "Checking for deleted filenames in #{SORBET_FILES_YAML}..."
|
|
||||||
lines_to_keep = []
|
|
||||||
sorbet_keywords = ["true:", "false:", "strict:", "strong:"]
|
|
||||||
|
|
||||||
File.readlines(SORBET_FILES_YAML).map(&:chomp).each do |line|
|
|
||||||
if sorbet_keywords.include?(line) || line.blank?
|
|
||||||
lines_to_keep << line
|
|
||||||
elsif line.end_with?(".rb")
|
|
||||||
filepath = line.split(" ").last
|
|
||||||
lines_to_keep << line if File.exist?(filepath)
|
|
||||||
end
|
|
||||||
|
|
||||||
File.write(SORBET_FILES_YAML, "#{lines_to_keep.join("\n")}\n")
|
|
||||||
end
|
|
||||||
|
|
||||||
ohai "Updating Tapioca RBI files..."
|
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"
|
||||||
@ -73,8 +56,6 @@ module Homebrew
|
|||||||
cd("sorbet")
|
cd("sorbet")
|
||||||
srb_exec += ["--file", "../#{args.file}"] if args.file
|
srb_exec += ["--file", "../#{args.file}"] if args.file
|
||||||
srb_exec += ["--dir", "../#{args.dir}"] if args.dir
|
srb_exec += ["--dir", "../#{args.dir}"] if args.dir
|
||||||
else
|
|
||||||
srb_exec += ["--typed-override", SORBET_FILES_YAML]
|
|
||||||
end
|
end
|
||||||
Homebrew.failed = !system(*srb_exec)
|
Homebrew.failed = !system(*srb_exec)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
false: []
|
|
||||||
true: []
|
|
||||||
strict: []
|
|
||||||
@ -1258,9 +1258,9 @@ Check for typechecking errors using Sorbet.
|
|||||||
* `-q`, `--quiet`:
|
* `-q`, `--quiet`:
|
||||||
Silence all non-critical errors.
|
Silence all non-critical errors.
|
||||||
* `--update`:
|
* `--update`:
|
||||||
Update RBI files and prune sorbet/files.yaml
|
Update RBI files.
|
||||||
* `--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`:
|
||||||
Typecheck all files in a specific directory.
|
Typecheck all files in a specific directory.
|
||||||
* `--file`:
|
* `--file`:
|
||||||
|
|||||||
@ -1743,11 +1743,11 @@ Silence all non\-critical errors\.
|
|||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-update\fR
|
\fB\-\-update\fR
|
||||||
Update RBI files and prune sorbet/files\.yaml
|
Update RBI files\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-fail\-if\-not\-changed\fR
|
\fB\-\-fail\-if\-not\-changed\fR
|
||||||
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\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-dir\fR
|
\fB\-\-dir\fR
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user