Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prektoml #1546 +/- ##
============================================
- Coverage 91.61% 91.60% -0.02%
============================================
Files 91 91
Lines 17981 18017 +36
============================================
+ Hits 16474 16504 +30
- Misses 1507 1513 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for a --format flag to the prek sample-config command, allowing users to generate sample configurations in TOML format in addition to the existing YAML format.
Changes:
- Added
--formatCLI argument withtomlandyamloptions to thesample-configcommand - Implemented TOML sample configuration that uses prek's builtin hooks
- Updated
cache dircommand to usestdout_important()for better visibility in quiet mode
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/prek/tests/sample_config.rs | Added comprehensive test coverage for TOML format support, including format detection, explicit format selection, and precedence rules; updated raw string delimiters for existing snapshots |
| crates/prek/src/main.rs | Wired the new format parameter to the sample_config command; changed cache dir output to use stdout_important() |
| crates/prek/src/cli/sample_config.rs | Implemented format detection from file extension, added TOML sample config constant, and updated function to handle format selection with proper precedence |
| crates/prek/src/cli/mod.rs | Added SampleConfigFormat enum and format field to SampleConfigArgs |
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.5 MiB → 23.5 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
765f55e to
115ca7c
Compare
Support `prek sample-config --format toml`
j178
added a commit
that referenced
this pull request
Feb 3, 2026
j178
added a commit
that referenced
this pull request
Feb 4, 2026
j178
added a commit
that referenced
this pull request
Feb 5, 2026
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.
Support
prek sample-config --format toml