Skip to content

feat(nix): allow treefmt.nix based setups#22

Merged
isbecker merged 3 commits into
mainfrom
feat/allow-treefmt-from-path
Dec 15, 2025
Merged

feat(nix): allow treefmt.nix based setups#22
isbecker merged 3 commits into
mainfrom
feat/allow-treefmt-from-path

Conversation

@isbecker

@isbecker isbecker commented Dec 13, 2025

Copy link
Copy Markdown
Owner
  • enables better behavior for files with no extensions
  • enables formatting unsaved files, if they have a selected filetype

Copilot AI review requested due to automatic review settings December 13, 2025 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for treefmt.nix-based setups and improves handling of files with no extensions. The main changes include enhanced stdin specifier generation, improved command resolution with executable validation, and migration from .treefmt.toml configuration to flake-based treefmt-nix setup.

Key Changes

  • Command resolution improvements: Added validation to check if treefmt commands are executable before using them, with fallback logic to check PATH and bundled binaries
  • Enhanced stdin handling: New logic to infer appropriate file extensions or names for stdin formatting based on VS Code's language ID mappings, improving support for files without extensions
  • treefmt-nix integration: Migrated from standalone .treefmt.toml to flake-based treefmt-nix configuration with declarative formatter setup

Reviewed changes

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

Show a summary per file
File Description
src/treefmtUtils.ts Added helper functions for tilde expansion, path detection, stdin specifier generation, and command validation
package.json Version bump to 2.4.0, added .treefmt.toml activation event, changed debug default to true
package-lock.json Updated dependencies to match package.json changes
flake.nix Integrated treefmt-nix module with declarative formatter configuration
flake.lock Updated lock file with treefmt-nix and dependency version updates
biome.json Updated schema version and reorganized import settings
esbuild.js Code formatting changes (quotes, spacing)
README.md Formatting improvements for badge layout
LICENSE.md Added markdown code block formatting to license text
.vscode-test.mjs/.js Quote style changes
.treefmt.toml Removed standalone configuration file
.github/workflows/format.yaml Updated to use Nix devShell and system treefmt

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

Comment thread src/treefmtUtils.ts Outdated
Comment thread src/treefmtUtils.ts Outdated
Comment thread src/treefmtUtils.ts
Comment thread src/treefmtUtils.ts Outdated
Comment thread package.json Outdated
@isbecker isbecker merged commit ca7871a into main Dec 15, 2025
2 checks passed
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