-
-
Notifications
You must be signed in to change notification settings - Fork 769
refactor(hook-env): derive config_subdirs from config filenames #7080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 refactors the hook_env.rs module to derive the config_subdirs list dynamically from DEFAULT_CONFIG_FILENAMES instead of using a hardcoded array. This improves maintainability by deriving the subdirectories from a single source of truth.
- Adds import for
DEFAULT_CONFIG_FILENAMESfrom the config module - Replaces hardcoded config subdirectory array with dynamic derivation using string splitting and deduplication
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let config_subdirs = DEFAULT_CONFIG_FILENAMES | ||
| .iter() | ||
| .map(|f| f.rsplit_once("/").map(|(dir, _)| dir).unwrap_or("")) | ||
| .unique() | ||
| .collect::<Vec<_>>(); |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The logic doesn't handle glob patterns correctly. When DEFAULT_CONFIG_FILENAMES contains patterns like .config/mise/conf.d/*.toml, the extracted directory .config/mise/conf.d would be checked, but this doesn't account for the fact that the actual config files might be in subdirectories matching the glob pattern.
However, checking the parent directory should still catch modifications when new files are added to that directory, so this is likely acceptable. Consider adding a comment explaining this behavior for future maintainers.
### 📦 Registry - enable symlink_bins for aws-sam by @risu729 in [#7082](#7082) - use cargo backend for tokei to support latest version by @risu729 in [#7086](#7086) - add SonarSource/sonar-scanner-cli by @kapitoshka438 in [#7087](#7087) ### 🐛 Bug Fixes - **(docs)** link gitlab backended tools in registry by @risu729 in [#7078](#7078) ### 🚜 Refactor - **(hook-env)** derive config_subdirs from config filenames by @risu729 in [#7080](#7080) ### New Contributors - @kapitoshka438 made their first contribution in [#7087](#7087) ## 📦 Aqua Registry Updates #### New Packages (1) - [`kiali/kiali`](https://github.com/kiali/kiali) #### Updated Packages (3) - [`XAMPPRocky/tokei`](https://github.com/XAMPPRocky/tokei) - [`astral-sh/uv`](https://github.com/astral-sh/uv) - [`wtfutil/wtf`](https://github.com/wtfutil/wtf)
The previous implementation didn't support
MISE_OVERRIDE_CONFIG_FILENAMESwith custom directories.