feat(nix): allow treefmt.nix based setups#22
Merged
Conversation
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.