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:
|
||||
push:
|
||||
paths:
|
||||
@ -39,7 +39,8 @@ jobs:
|
||||
|
||||
if brew typecheck --update --fail-if-not-changed; then
|
||||
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"
|
||||
if [ -n "$BRANCH_EXISTS" ]; then
|
||||
echo "::set-output name=pull_request::true"
|
||||
|
||||
@ -6,8 +6,6 @@ require "cli/parser"
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
SORBET_FILES_YAML = "sorbet/files.yaml"
|
||||
|
||||
def typecheck_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
@ -18,10 +16,10 @@ module Homebrew
|
||||
switch "-q", "--quiet",
|
||||
description: "Silence all non-critical errors."
|
||||
switch "--update",
|
||||
description: "Update RBI files and prune #{SORBET_FILES_YAML}"
|
||||
description: "Update RBI files."
|
||||
switch "--fail-if-not-changed",
|
||||
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=",
|
||||
description: "Typecheck all files in a specific directory."
|
||||
flag "--file=",
|
||||
@ -41,21 +39,6 @@ module Homebrew
|
||||
|
||||
HOMEBREW_LIBRARY_PATH.cd do
|
||||
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..."
|
||||
system "bundle", "exec", "tapioca", "sync"
|
||||
system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
||||
@ -73,8 +56,6 @@ module Homebrew
|
||||
cd("sorbet")
|
||||
srb_exec += ["--file", "../#{args.file}"] if args.file
|
||||
srb_exec += ["--dir", "../#{args.dir}"] if args.dir
|
||||
else
|
||||
srb_exec += ["--typed-override", SORBET_FILES_YAML]
|
||||
end
|
||||
Homebrew.failed = !system(*srb_exec)
|
||||
end
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
false: []
|
||||
true: []
|
||||
strict: []
|
||||
@ -1258,9 +1258,9 @@ Check for typechecking errors using Sorbet.
|
||||
* `-q`, `--quiet`:
|
||||
Silence all non-critical errors.
|
||||
* `--update`:
|
||||
Update RBI files and prune sorbet/files.yaml
|
||||
Update RBI files.
|
||||
* `--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`:
|
||||
Typecheck all files in a specific directory.
|
||||
* `--file`:
|
||||
|
||||
@ -1743,11 +1743,11 @@ Silence all non\-critical errors\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-update\fR
|
||||
Update RBI files and prune sorbet/files\.yaml
|
||||
Update RBI files\.
|
||||
.
|
||||
.TP
|
||||
\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
|
||||
\fB\-\-dir\fR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user