Skip to content

Dotenv::Railtie deprecation warning triggered by static analysis tools #544

@agrberg

Description

@agrberg

Tools like tapioca (Sorbet's RBI generator) enumerate all constants in loaded gems to generate type definitions. Because Dotenv::Railtie is defined using ActiveSupport::Deprecation::DeprecatedConstantProxy, it registers a real constant on the Dotenv module. This means Dotenv.constants includes :Railtie, and any tool that iterates over those constants triggers the deprecation warning — even though the user never references Dotenv::Railtie in their own code.

DEPRECATION WARNING: Dotenv::Railtie is deprecated! Use Dotenv::Rails instead.

There's no way for users to suppress this since the warning comes from tooling, not their application code.

Replacing DeprecatedConstantProxy with a const_missing hook would preserve the deprecation behavior for actual usage while keeping :Railtie out of Dotenv.constants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions