Skip to content

Commit

Permalink
Merge pull request #172 from Homebrew/sorbet
Browse files Browse the repository at this point in the history
Basic Sorbet `typed: true`
  • Loading branch information
issyl0 authored Aug 20, 2024
2 parents b73e08b + 1e5c529 commit 5bd834a
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

- run: brew test-bot --only-tap-syntax

- run: brew typecheck homebrew/command-not-found

- run: brew install bash fish

- name: Validate shell syntax
Expand Down
1 change: 1 addition & 0 deletions cmd/command-not-found-init.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require "abstract_command"
Expand Down
1 change: 1 addition & 0 deletions cmd/which-formula.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require "abstract_command"
Expand Down
11 changes: 11 additions & 0 deletions cmd/which-formula.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# typed: strict

class Homebrew::Cmd::WhichFormulaCmd
sig { returns(Homebrew::Cmd::WhichFormulaCmd::Args) }
def args; end
end

class Homebrew::Cmd::WhichFormulaCmd::Args < Homebrew::CLI::Args
sig { returns(T::Boolean) }
def explain?; end
end
1 change: 1 addition & 0 deletions cmd/which-update.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require "abstract_command"
Expand Down
26 changes: 26 additions & 0 deletions cmd/which-update.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# typed: strict

class Homebrew::Cmd::WhichUpdateCmd
sig { returns(Homebrew::Cmd::WhichUpdateCmd::Args) }
def args; end
end

class Homebrew::Cmd::WhichUpdateCmd::Args < Homebrew::CLI::Args
sig { returns(T::Boolean) }
def stats?; end

sig { returns(T::Boolean) }
def commit?; end

sig { returns(T::Boolean) }
def update_existing?; end

sig { returns(T::Boolean) }
def install_missing?; end

sig { returns(T::Boolean) }
def eval_all?; end

sig { params(max_downloads: T.nilable(Integer)).returns(T::Boolean) }
def max_downloads(max_downloads = nil); end
end
1 change: 1 addition & 0 deletions lib/executables_db.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require "formula"
Expand Down
1 change: 1 addition & 0 deletions lib/which_formula.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require "formula"
Expand Down
7 changes: 7 additions & 0 deletions lib/which_formula.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# typed: strict

module Homebrew
module WhichFormula
include Kernel
end
end
1 change: 1 addition & 0 deletions lib/which_update.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# typed: true
# frozen_string_literal: true

require_relative "../lib/executables_db"
Expand Down
7 changes: 7 additions & 0 deletions lib/which_update.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# typed: strict

module Homebrew
module WhichUpdate
include Kernel
end
end

0 comments on commit 5bd834a

Please sign in to comment.