Skip to content

Add Sorbet strict typing to ApplicationController and SeedDataService with detailed type annotations#197

Merged
stefan-burke merged 9 commits intomainfrom
terragon/add-sorbet-types-application-controller
Aug 13, 2025
Merged

Add Sorbet strict typing to ApplicationController and SeedDataService with detailed type annotations#197
stefan-burke merged 9 commits intomainfrom
terragon/add-sorbet-types-application-controller

Conversation

@stefan-burke
Copy link
Copy Markdown
Member

@stefan-burke stefan-burke commented Aug 13, 2025

Summary

  • Upgrades ApplicationController and SeedDataService to use Sorbet strict typing
  • Adds detailed Sorbet type signatures (sig) to methods and constants for improved type safety and clarity
  • Changes file typing from false to strict to enforce type checking
  • Introduces T.let for constant type declarations in SeedDataService

Changes

Typing Enhancements

  • Added extend T::Sig to enable Sorbet signatures in both classes
  • Annotated methods with precise Sorbet sig types, including:
    • Return types such as T::Boolean, T.nilable(Float), T::Array[T::Hash[Symbol, T.untyped]], and void
    • Parameter types for methods accepting arguments
  • Declared constants in SeedDataService with T.let for explicit type annotations
  • Updated file headers to # typed: strict for strict type enforcement

Codebase Impact

  • Improved code reliability and maintainability through explicit type contracts
  • Facilitates better static analysis and error detection during development

Test plan

  • Verify application runs without type errors under Sorbet
  • Confirm all controller actions behave as expected
  • Run existing test suite to ensure no regressions
  • Validate that type signatures align with method implementations

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/44864bdd-99bf-49a8-9746-7510dc6ee2a2

stefan-burke and others added 5 commits August 13, 2025 16:01
…le strict typing

- Changed Sorbet typing from false to strict
- Added `extend T::Sig` for method signature support
- Added type signatures to multiple methods for better type safety and clarity
- No functional changes, only type annotations and typing enforcement

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Changed string keys to symbol keys in form_i18n calls for consistency and style improvement.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…atures

- Change typed level from false to strict
- Add T::Sig method signatures to all methods
- Use T.let for typed instance variable
- Add type annotations for method parameters and return types

This improves type safety and code clarity in SeedDataService.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@stefan-burke stefan-burke changed the title Add Sorbet strict typing to ApplicationController Add Sorbet strict typing to ApplicationController and SeedDataService Aug 13, 2025
Add Sorbet T.let type annotations to constants in SeedDataService for improved type safety and clarity.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@stefan-burke stefan-burke changed the title Add Sorbet strict typing to ApplicationController and SeedDataService Add Sorbet strict typing to ApplicationController and SeedDataService with detailed type annotations Aug 13, 2025
@stefan-burke stefan-burke marked this pull request as ready for review August 13, 2025 16:51
@stefan-burke stefan-burke merged commit 7cb1d50 into main Aug 13, 2025
16 of 17 checks passed
@stefan-burke stefan-burke deleted the terragon/add-sorbet-types-application-controller branch August 13, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant