fix: use ~/.config as the canonical macOS config path#81
Merged
Conversation
There was a problem hiding this comment.
2 issues found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cmd/fence/main.go">
<violation number="1" location="cmd/fence/main.go:64">
P2: The new help text hardcodes `~/.config` on Linux, but the actual default follows `os.UserConfigDir()`/`XDG_CONFIG_HOME`, so it can document the wrong path.</violation>
</file>
<file name="internal/config/config.go">
<violation number="1" location="internal/config/config.go:175">
P2: Checking the canonical directory before legacy files can hide an existing legacy config. On macOS, an empty `~/.config/fence/` makes `DefaultConfigPath()` ignore `~/Library/Application Support/...` and `~/.fence.json` even when those files exist.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
3 issues found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/library.md">
<violation number="1" location="docs/library.md:86">
P2: Use `LoadConfigResolved` here so relative `extends` entries work the same way as the CLI.</violation>
<violation number="2" location="docs/library.md:101">
P3: This sentence overstates the legacy fallback. `ResolveDefaultConfigPath()` still returns the canonical path once `~/.config/fence/` exists, even if a legacy config file exists.</violation>
</file>
<file name="cmd/fence/main.go">
<violation number="1" location="cmd/fence/main.go:199">
P2: This can skip an existing legacy macOS config whenever `~/.config/fence/` exists but `~/.config/fence/fence.json` does not.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
~/.config/fence/fence.jsonthe canonical config location on macOS so new configs go where users expect, while preserving reads from legacy macOS paths until a real canonical config file exists. Also tighten the docs so Linux path guidance matchesXDG_CONFIG_HOMEand library examples behave like the CLI.Resolves #75.
Changes
ResolveDefaultConfigPath()so existing legacy macOS configs are still honored during migrationUserConfigDirbehaviorResolveDefaultConfigPath()in the public package APILoadConfigResolved()so relativeextendspaths resolve the same way as the CLI$XDG_CONFIG_HOMEand macOS in terms of~/.config/fence/fence.json