Skip to content

refactor: use consistent path construction throughout codebase #12

@LudoLoops

Description

@LudoLoops

Issue

Path construction is inconsistent across the codebase:

Examples:

  • task/create.go:28: Uses fmt.Sprintf("%s%s", path, name)
  • utils/storage.go:13: Uses filepath.Join(cfg.General.VaultPath, projectName)
  • task/finish.go:82: Uses utils.ListMarkdownFiles()
  • Other places mix approaches

Problem

Solution

  1. Always use filepath.Join for path construction
  2. Create wrapper function in utils if needed:
func GetProjectDir(cfg config.Config, projectName string) string {
    return filepath.Join(cfg.General.VaultPath, projectName)
}
  1. Audit entire codebase for consistency

Impact

🟢 Low - Code quality and safety

Metadata

Metadata

Assignees

No one assigned

    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