dry-auto_inject 1.2.0 released

Added

  • Ship a DryAutoInject/DependencyOrder rubocop cop that enforces a configurable order for dependencies inside Import[...] calls. Non-aliased deps are emitted first, then aliased ones; within each section, deps are grouped by the configured Order patterns and sorted alphabetically inside a group. Supported pattern forms: '*' (catch-all, at most one and implicitly appended), 'prefix.*', /regex/flags, or an exact path. The cop also autocorrects. (@flash-gordon in #96)

    Enable it from your .rubocop.yml using RuboCop’s plugin system (requires RuboCop 1.72+):

    plugins:
      - dry-auto_inject
    
    DryAutoInject/DependencyOrder:
      Enabled: true
      InjectorModules:  # Default is [Import, *::Import, Deps, *::Deps]
        - Deps          # exact constant
        - "*::Deps"     # match any namespace ending in `::Deps`
      Order:
        - "web.*"
        - "*"
        - "core.*"
    
  • Ship a DryAutoInject/RedundantAlias rubocop cop that flags Import[foo: 'some.path.foo']-style imports where the alias matches the last segment of the path, since dry-auto_inject already derives the dependency key from that segment. The cop autocorrects by promoting redundant aliases to non-aliased deps, preserving the original quoting. (@flash-gordon in #98)

Fixed

  • Ancestor parameter detection for smart kwarg forwarding is no longer obscured by injections in a parent class. (@alassek in #97)

Changed

  • Update minimum Ruby version to 3.3. (@timriley)

View release on GitHub