File tree Expand file tree Collapse file tree 7 files changed +40
-6
lines changed Expand file tree Collapse file tree 7 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1818 - name : Setup Rust
1919 uses : hecrj/setup-rust-action@v2
2020 with :
21- rust-version : nightly
21+ rust-version : stable
22+ profile : minimal
2223 - name : Set up Python
2324 uses : actions/setup-python@v5
2425 with :
5455 - name : Setup Rust
5556 uses : hecrj/setup-rust-action@v2
5657 with :
57- rust-version : nightly
58+ rust-version : stable
59+ profile : minimal
5860 - name : Build
5961 run : cargo build --release
6062
7375 - name : Setup Rust
7476 uses : hecrj/setup-rust-action@v2
7577 with :
76- rust-version : nightly
78+ rust-version : stable
79+ profile : minimal
7780 - name : Cache dependencies
7881 uses : actions/cache@v4
7982 with :
@@ -100,6 +103,9 @@ jobs:
100103 - uses : actions/checkout@v4
101104 - name : Setup Rust
102105 uses : hecrj/setup-rust-action@v2
106+ with :
107+ rust-version : stable
108+ profile : minimal
103109 - name : Publish
104110 run : |
105111 cargo login ${{ secrets.CRATES_TOKEN }}
@@ -115,6 +121,9 @@ jobs:
115121 - uses : actions/checkout@v4
116122 - name : Setup Rust
117123 uses : hecrj/setup-rust-action@v2
124+ with :
125+ rust-version : stable
126+ profile : minimal
118127 - name : Publish
119128 run : |
120129 cargo login ${{ secrets.CRATES_TOKEN }}
Original file line number Diff line number Diff line change 1+ config :
2+ no-duplicate-heading : false
3+ first-line-heading : false
Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 2024-09-27 - [ 0.1.2]
4+
5+ ### Bug fixes
6+
7+ - Exit code 1 when files formatted.
8+
39## 2024-09-27 - [ 0.1.1]
410
511### Bug fixes
1016
1117First beta release
1218
19+ [ 0.1.2 ] : https://github.com/mondeja/hledger-fmt/compare/v0.1.1...v0.1.2
1320[ 0.1.1 ] : https://github.com/mondeja/hledger-fmt/compare/v0.1.0...v0.1.1
Original file line number Diff line number Diff line change 11[package ]
22name = " hledger-fmt"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44edition = " 2021"
55description = " An opinionated hledger's journal files formatter."
66repository = " https://github.com/mondeja/hledger-fmt"
Original file line number Diff line number Diff line change @@ -30,6 +30,19 @@ cargo binstall hledger-fmt
3030
3131We don't currently provide standalone pre-built binaries.
3232
33+ ### pre-commit
34+
35+ Use it with [ pre-commit] by adding the hook to your _ .pre-commit-config.yaml_ :
36+
37+ ``` yaml
38+ repos :
39+ - repo : https://github.com/mondeja/hledger-fmt
40+ rev : vX.Y.Z
41+ hooks :
42+ # id: hledger-fmt # Use this id to format files in place
43+ - id : hledger-fmt-check # Use this id to check files without formatting
44+ ` ` `
45+
3346## Usage
3447
3548When you don't pass files to format, it reads all the files with
@@ -61,3 +74,4 @@ accepted to make it more flexible. Send a PR if you want to help.
6174[cargo-binstall] : https://github.com/cargo-bins/cargo-binstall
6275[hledger] : https://hledger.org
6376[cargo] : https://doc.rust-lang.org/cargo/
77+ [pre-commit] : https://pre-commit.com
Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ fn main() {
125125 continue ;
126126 }
127127
128+ exitcode = 1 ;
129+
128130 if args. fix {
129131 match std:: fs:: write ( & file, & formatted) {
130132 Ok ( _) => { }
@@ -135,7 +137,6 @@ fn main() {
135137 eprintln ! ( ) ;
136138 }
137139 eprintln ! ( "Error writing file {file}: {e}" ) ;
138- exitcode = 1 ;
139140 }
140141 }
141142 } else {
You can’t perform that action at this time.
0 commit comments