Shopify / rbi-central

MIT License
55 stars 36 forks source link

Add versioning to ErrorReporter methods and backfill 7.0 signatures #278

Open bdewater opened 1 month ago

bdewater commented 1 month ago

Type of Change

Changes

bdewater commented 1 month ago

This is causing linting errors:

### Linting RBI files...

Linting activesupport...

Error: rbi/annotations/activesupport.rbi:486:3: W: Lint/DuplicateMethods: Method ActiveSupport::ErrorReporter#handle is defined at both rbi/annotations/activesupport.rbi:471 and rbi/annotations/activesupport.rbi:486.
  def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
  ^^^^^^^^^^
rbi/annotations/activesupport.rbi:513:3: W: Lint/DuplicateMethods: Method ActiveSupport::ErrorReporter#record is defined at both rbi/annotations/activesupport.rbi:499 and rbi/annotations/activesupport.rbi:513.
  def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
  ^^^^^^^^^^
rbi/annotations/activesupport.rbi:536:3: W: Lint/DuplicateMethods: Method ActiveSupport::ErrorReporter#report is defined at both rbi/annotations/activesupport.rbi:5[24](https://github.com/Shopify/rbi-central/actions/runs/10372306547/job/28714725504#step:4:25) and rbi/annotations/activesupport.rbi:536.
  def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
  ^^^^^^^^^^

and fails static checking:

### Checking RBI files against Tapioca and Sorbet...

Checking static for activesupport...

Error: rbi/annotations/activesupport.rbi:486: Method ActiveSupport::ErrorReporter#handle redefined without matching argument count. Expected: 4, got: 5 https://srb.help/4010
     486 |  def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

rbi/annotations/activesupport.rbi:[51](https://github.com/Shopify/rbi-central/actions/runs/10372306547/job/28714725504?pr=278#step:4:52)3: Method ActiveSupport::ErrorReporter#record redefined without matching argument count. Expected: 3, got: 4 https://srb.help/4010
     513 |  def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

rbi/annotations/activesupport.rbi:[53](https://github.com/Shopify/rbi-central/actions/runs/10372306547/job/28714725504?pr=278#step:4:54)6: Method ActiveSupport::ErrorReporter#report redefined without matching argument count. Expected: 4, got: 5 https://srb.help/4010
     536 |  def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^