Crates.io | hledger-fmt |
lib.rs | hledger-fmt |
version | |
source | src |
created_at | 2024-09-27 12:30:01.668038 |
updated_at | 2025-02-09 01:31:45.65332 |
description | An opinionated hledger's journal files formatter. |
homepage | |
repository | https://github.com/mondeja/hledger-fmt |
max_upload_size | |
id | 1388623 |
Cargo.toml error: | TOML parse error at line 29, column 1 | 29 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
An opinionated hledger's journal files formatter.
Download standalone pre-built binaries from releases page.
Install from pre-built binaries using cargo-binstall:
cargo binstall hledger-fmt
Build from source using cargo:
cargo install hledger-fmt
Use it with pre-commit by adding the hook to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/mondeja/hledger-fmt
rev: vX.Y.Z
hooks:
# id: hledger-fmt # Use this id to format files in place
- id: hledger-fmt-check # Use this id to check files without formatting
With hledger-fmt in your PATH, use the VSCode Custom Local Formatters extension. Just install it and add the next configuration to your settings.json:
{
"customLocalFormatters.formatters": [
{
"command": "hledger-fmt - --no-diff",
"languages": ["hledger"]
}
]
}
To format on save:
{
"editor.formatOnSave": true
}
When you don't pass files to format, it reads all the files with
the extensions .journal
, .hledger
and .j
in the current directory
and its subdirectories.
hledger-fmt [OPTIONS] [FILES]...
To fix them in place, use the --fix
option:
[!WARNING]
This is a potentially destructive operation. Make sure to make a backup of your files before running this command for the first time.
hledger-fmt --fix [FILES]...
See hledger-fmt --help
for more information.
color
(enabled by default): Build with terminal color support.auto-color
(enabled by default): Automatically detects if your terminal
supports colors.