yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

Change two recently added classes to strict typing #415

Closed yob closed 2 years ago

yob commented 2 years ago

New code may as well go all in on type hints. I'll be interested to see if this helps with maintainability over time.

Thanks to this answer on stackoverflow for pointing me in the right direction: https://stackoverflow.com/questions/70515191/how-can-i-resolve-sorbet-error-use-of-undeclared-variable/70519194#70519194

yob commented 2 years ago

I wonder if I could fail the build if a new ruby file added since sorbet was introduced was missing strict typing? Maybe something based on this git command that lists files added since the relevant commit:

$ git diff --numstat --diff-filter=A feb9203 main -- lib/
16      0       lib/pdf/reader/bounding_rectangle_runs_filter.rb
25      0       lib/pdf/reader/point.rb
113     0       lib/pdf/reader/rectangle.rb