Skip to content

Clean up mkConf / mkConfig / mkConfigAbs naming in cardano-testnet #6569

Description

@carbolymer

Testnet.Start.Types has three functions for creating Conf values:

  • mkConf :: (HasCallStack, MonadTest m) => FilePath -> m Conf - annotates the path in test output, then calls mkConfig
  • mkConfig :: FilePath -> Conf - pure, adds trailing separator and defaults
  • mkConfigAbs :: FilePath -> IO Conf - makes path absolute, creates directory, calls mkConfig

The names do not communicate the differences.
mkConf vs mkConfig looks like a typo rather than a meaningful distinction.
mkConfigAbs conflates "make path absolute" with "run in IO".

Suggested cleanup (open to better ideas):

  • mkConfig stays as the pure core
  • mkConf becomes something like mkConfigForTest or mkConfigAnnotated to signal the MonadTest dependency
  • mkConfigAbs becomes something like mkConfigAbsolute or mkConfigIO

Or collapse them if the separate variants are not pulling their weight.

Context: Flagged by @carbolymer in #6346 review comments.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions