cristibalan / braid

Simple tool to help track vendor branches in a Git repository.
http://cristibalan.github.io/braid
MIT License
457 stars 64 forks source link

Finish first pass of type annotations for `lib` + other small changes. #123

Closed mattmccutchen closed 2 months ago

mattmccutchen commented 3 months ago

This gets most files in lib to typed: strict. I also looked briefly at the output of Sorbet's "highlight untyped code" feature and made a few more obvious fixes.

Notable large changes:

Notable small changes:


The tests pass on my Linux and Windows systems.

realityforge commented 3 months ago

Still on my radar ... although I may not get a chance to look at it until tomorrow or Saturday ;-)

realityforge commented 2 months ago

I did need to make one change to this PR to get it to work for me. I suspect it is because I am using an older version (2.7.2) of ruby?

Other than that - good work!

$ git diff
diff --git a/lib/braid/sorbet/fake_runtime.rb b/lib/braid/sorbet/fake_runtime.rb
index 387768c..90452df 100644
--- a/lib/braid/sorbet/fake_runtime.rb
+++ b/lib/braid/sorbet/fake_runtime.rb
@@ -88,7 +88,7 @@ module Braid
         define_method(prop_name) {
           @attrs[prop_name]
         }
-        define_method(prop_name.name + '=') { |new_value|
+        define_method(:"#{prop_name}=") { |new_value|
           @attrs[prop_name] = new_value
         }
       end