Skip to content

refactor(nix): simplify oxfmt includes to wildcard pattern#138

Merged
ryoppippi merged 1 commit intomainfrom
oxfmt
Feb 4, 2026
Merged

refactor(nix): simplify oxfmt includes to wildcard pattern#138
ryoppippi merged 1 commit intomainfrom
oxfmt

Conversation

@ryoppippi
Copy link
Copy Markdown
Contributor

@ryoppippi ryoppippi commented Feb 4, 2026

Simplifies the oxfmt formatter configuration by replacing the explicit file extension list with a wildcard pattern. The --no-error-on-unmatched-pattern flag 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.

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.
Copilot AI review requested due to automatic review settings February 4, 2026 11:58
@ryoppippi ryoppippi merged commit 32e78d3 into main Feb 4, 2026
12 of 20 checks passed
@ryoppippi ryoppippi deleted the oxfmt branch February 4, 2026 11:58
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Copy Markdown
Contributor

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 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-pattern option to suppress errors for unsupported files

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

];
includes = [ "*" ];
excludes = [
"CHANGELOG.md"
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

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:

  1. Auto-generated lock files (flake.lock, uv.lock) which shouldn't be manually formatted
  2. Vendor/third-party code (vendor/**) which can cause merge conflicts when updated
  3. 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.

Suggested change
"CHANGELOG.md"
"CHANGELOG.md"
"*.lock"
"*.py"
"*.nix"
"vendor/**"

Copilot uses AI. Check for mistakes.
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.

2 participants