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

Add helpful failure output for Sorbet linter #1038

Merged
merged 1 commit into from
Aug 10, 2023
Merged
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
12 changes: 9 additions & 3 deletions bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ end.parse!

GEM_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
def system!(*args, failure: nil)
system(*args) || abort("\n== Command #{args} failed ==#{failure ? "\n\n#{failure}" : ''}}")
end

FileUtils.chdir GEM_ROOT do
puts "\n== Sorbet =="

system! "bundle exec srb tc"
system! "bundle exec srb tc", failure: <<~MESSAGE
You may need to run one of the following commands
- bin/tapioca todo # generate RBI files for unresolved constants (e.g. RSpec `stub_const`)
- bin/tapioca dsl # generate RBIs for dynamic methods
- bin/tapioca gem # generate RBIs for gems
- bin/tapioca check-shims # check duplicated definitions in shim RBIs
MESSAGE

puts "\n== Rubocop =="

Expand Down