Skip to content

feat(config): allow reading configuration from xdg directories#155

Merged
cococonscious merged 4 commits intocococonscious:mainfrom
jhamill34:jhamill34/featconfig-allow-reading-configuration-from-xdg-directories
Nov 30, 2025
Merged

feat(config): allow reading configuration from xdg directories#155
cococonscious merged 4 commits intocococonscious:mainfrom
jhamill34:jhamill34/featconfig-allow-reading-configuration-from-xdg-directories

Conversation

@jhamill34
Copy link
Contributor

On MacOS the "default" configuration directories do not follow the XDG standards.
This change allows the use of those standards on a mac if the environment variable for XDG_CONFIG_HOME has been set.

Closes: #154

Created using spr 1.3.7
Created using spr 1.3.7
Created using spr 1.3.7
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/lib/config.rs 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Created using spr 1.3.7
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for XDG Base Directory specification on macOS by checking the XDG_CONFIG_HOME environment variable when loading configuration files, allowing macOS users who prefer XDG conventions to use them alongside the platform's default configuration directory.

Key Changes:

  • Adds xdg crate dependency to read configuration from XDG-compliant directories
  • Updates configuration loading logic to check both platform default and XDG config locations
  • Improves test infrastructure by configuring git user identity in test repositories

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Cargo.toml Adds xdg 3.0 dependency for XDG Base Directory support
Cargo.lock Adds xdg dependency and updates transitive dependencies (windows-sys)
src/lib/config.rs Implements XDG config directory support with updated configuration loading order
src/bin/main.rs Refactors command handling to use idiomatic Rust pattern (if let instead of is_some/unwrap)
tests/integration.rs Adds XDG config integration test and improves test setup by configuring git identity
README.md Documents new XDG config directory in configuration priority order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cococonscious cococonscious merged commit 0eab252 into cococonscious:main Nov 30, 2025
10 checks passed
This was referenced Feb 19, 2025
cococonscious pushed a commit that referenced this pull request Nov 30, 2025
## 🤖 New release

* `koji`: 3.2.0 -> 3.3.0 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[3.3.0](v3.2.0...v3.3.0) -
2025-11-30

### Changed

- *(deps)* update codecov/codecov-action action to v5.5.1
([#143](#143))
- *(deps)* upgrade all dependencies
([#149](#149))
- *(build)* reintroduce musl builds
([#156](#156))
- replace rusty-hook with prek
- *(config)* allow reading configuration from xdg directories
([#155](#155))
- update all non-major dependencies
([#136](#136))
- *(deps)* update codecov/codecov-action action to v5.3.1
([#135](#135))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jhamill34 jhamill34 deleted the jhamill34/featconfig-allow-reading-configuration-from-xdg-directories branch December 1, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom config file not loading $HOME/.config/koji/config.toml on macos

3 participants