Added
-
Ship a
DryAutoInject/DependencyOrderrubocop cop that enforces a configurable order for dependencies insideImport[...]calls. Non-aliased deps are emitted first, then aliased ones; within each section, deps are grouped by the configuredOrderpatterns 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.ymlusing 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/RedundantAliasrubocop cop that flagsImport[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)