Skip to content

Refactor: Replace global settings singleton with lazy initialization #49

Description

@shimpeiws

Summary

In config.py, settings = Settings() is instantiated at module load time. This makes it difficult to override settings during tests (DI-unfriendly).

Proposed Approach

  • Replace the module-level settings = Settings() with a get_settings() function that lazily initializes the singleton
  • Allow tests to override settings via the function or a reset mechanism
  • Update all call sites that reference settings directly

Affected Files

  • src/barscan/config.py
  • All files that import settings from config.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions