Skip to content

Actionable error for missing global Lucafile and hoist duplicated scope variable#79

Merged
albertodebortoli merged 1 commit intomainfrom
fix/minor-polishing-post-76
Apr 27, 2026
Merged

Actionable error for missing global Lucafile and hoist duplicated scope variable#79
albertodebortoli merged 1 commit intomainfrom
fix/minor-polishing-post-76

Conversation

@albertodebortoli
Copy link
Copy Markdown
Member

Pull Request Title

Actionable error for missing global Lucafile and hoist duplicated scope variable

Description

  • Adds InstallCommandError.globalLucafileMissing so that luca install --global with no Lucafile at ~/.config/luca/Lucafile surfaces a clear, actionable error message ("No global Lucafile found at … Create one to get started.") instead of a raw file-not-found from SpecLoader.
  • Hoists the duplicated scope variable in Installer.installVerbose(installationType:useNpx:isGlobal:) to a single declaration before the if/else branches.

Type of Change

  • Feature
  • Bug fix
  • Maintenance / Refactor
  • Documentation
  • CI / Tooling
  • Other (specify)

How Has This Been Tested?

  • Swift code builds locally (swift build)
  • Manually tested locally (describe)
  • Added / updated unit tests
  • Tested on macOS (arch: arm64)

Screenshots / Demo (if applicable)

N/A

Checklist

  • Swift code builds locally (swift build)
  • Tests pass locally (swift test)
  • Code style / formatting respected
  • Documentation updated (README / comments)
  • Version / tag alignment considered (if release related)
  • PR title follows conventional style (optional)

CI Considerations

  • Affects build time notably
  • Requires new secrets / env vars
  • Alters release process

Breaking Changes?

  • No
  • Yes (describe impact and migration path)

Additional Notes

No new tests added — the guard lives in InstallCommand.run() where fileManager is not injected, so a unit test would require a DI refactor of the command layer, which is out of scope here.

…duplicated scope variable

- Add InstallCommandError.globalLucafileMissing and guard in InstallCommand.run() so
  `luca install --global` with no Lucafile at ~/.config/luca/Lucafile surfaces a clear
  "No global Lucafile found ... Create one to get started." message instead of a raw
  file-not-found error from SpecLoader.
- Hoist the duplicated `scope` variable in Installer.installVerbose(installationType:useNpx:isGlobal:)
  to a single declaration before the if/else branches.
@albertodebortoli albertodebortoli added this to the 0.18.0 milestone Apr 27, 2026
@albertodebortoli albertodebortoli added the refactoring Refactoring work label Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@albertodebortoli albertodebortoli merged commit e2db67e into main Apr 27, 2026
3 checks passed
@albertodebortoli albertodebortoli deleted the fix/minor-polishing-post-76 branch April 27, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Refactoring work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant