Conversation
Replace explicit file extension list with wildcard pattern for oxfmt formatter configuration. The --no-error-on-unmatched-pattern flag handles unsupported file types gracefully, making the explicit list unnecessary.
There was a problem hiding this comment.
Pull request overview
This PR simplifies the oxfmt formatter configuration in the Nix flake by replacing an explicit list of 10 file extensions with a wildcard pattern "*", relying on the --no-error-on-unmatched-pattern flag to handle unsupported file types gracefully.
Changes:
- Replaced specific file extension includes (*.md, *.yml, *.json, *.ts, *.js, etc.) with wildcard pattern
- Maintained the
--no-error-on-unmatched-patternoption to suppress errors for unsupported files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ]; | ||
| includes = [ "*" ]; | ||
| excludes = [ | ||
| "CHANGELOG.md" |
There was a problem hiding this comment.
The wildcard pattern in includes will match all git-tracked files, but the excludes list is incomplete. The change will cause oxfmt to be invoked on file types that should be excluded:
- Auto-generated lock files (flake.lock, uv.lock) which shouldn't be manually formatted
- Vendor/third-party code (vendor/**) which can cause merge conflicts when updated
- Files already handled by other formatters (*.py by ruff, *.nix by nixfmt)
The original explicit file extension list avoided these issues by only including specific file types. If keeping the wildcard pattern, the excludes list should be expanded to prevent processing these files. Consider:
excludes = [
"CHANGELOG.md"
"*.lock"
"*.py"
"*.nix"
"vendor/**"
];This maintains the simplicity of the wildcard while avoiding unnecessary processing and potential issues.
| "CHANGELOG.md" | |
| "CHANGELOG.md" | |
| "*.lock" | |
| "*.py" | |
| "*.nix" | |
| "vendor/**" |
Simplifies the oxfmt formatter configuration by replacing the explicit file extension list with a wildcard pattern. The
--no-error-on-unmatched-patternflag handles unsupported file types gracefully, making the explicit list unnecessary and easier to maintain.Summary by cubic
Simplify oxfmt configuration by replacing the explicit file extension includes with a single wildcard. The --no-error-on-unmatched-pattern flag ignores unsupported files, reducing maintenance without changing formatting behavior; existing excludes like CHANGELOG.md remain.
Written for commit b4c216c. Summary will update on new commits.