beancount-format 0.1.15__tar.gz → 0.1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {beancount_format-0.1.15 → beancount_format-0.1.16}/Cargo.lock +14 -13
  2. {beancount_format-0.1.15 → beancount_format-0.1.16}/Cargo.toml +3 -2
  3. {beancount_format-0.1.15 → beancount_format-0.1.16}/PKG-INFO +10 -2
  4. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/format.rs +1 -4
  5. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format_cases.rs +3 -3
  6. {beancount_format-0.1.15 → beancount_format-0.1.16}/pyproject.toml +1 -1
  7. {beancount_format-0.1.15 → beancount_format-0.1.16}/python/README.md +9 -1
  8. {beancount_format-0.1.15 → beancount_format-0.1.16}/LICENSE +0 -0
  9. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/Cargo.toml +0 -0
  10. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/configuration/configuration.rs +0 -0
  11. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/configuration/mod.rs +0 -0
  12. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/configuration/new_line_kind.rs +0 -0
  13. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/lib.rs +0 -0
  14. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/src/parse.rs +0 -0
  15. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/applies_configured_crlf_newlines.config.json +0 -0
  16. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/applies_configured_crlf_newlines.expected.bean +0 -0
  17. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/applies_configured_crlf_newlines.input.bean +0 -0
  18. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/caps_blank_lines_between_directives.expected.bean +0 -0
  19. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/caps_blank_lines_between_directives.input.bean +0 -0
  20. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_all_directives.config.json +0 -0
  21. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_all_directives.expected.bean +0 -0
  22. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_all_directives.input.bean +0 -0
  23. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_transaction_preserves_postings.expected.bean +0 -0
  24. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_transaction_preserves_postings.input.bean +0 -0
  25. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_without_changes_returns_none.expected.bean +0 -0
  26. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/formats_without_changes_returns_none.input.bean +0 -0
  27. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/normalizes_tabs_and_trailing_spaces.expected.bean +0 -0
  28. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/normalizes_tabs_and_trailing_spaces.input.bean +0 -0
  29. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve-meta.expected.bean +0 -0
  30. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve-meta.input.bean +0 -0
  31. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve_comments.expected.bean +0 -0
  32. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve_comments.input.bean +0 -0
  33. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve_file_path_header.expected.bean +0 -0
  34. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/preserve_file_path_header.input.bean +0 -0
  35. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/support_input_without_eol.expected.bean +0 -0
  36. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter/tests/format-and-check/support_input_without_eol.input.bean +0 -0
  37. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-cli/Cargo.toml +0 -0
  38. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-cli/src/lib.rs +0 -0
  39. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-cli/src/main.rs +0 -0
  40. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-cli/tests/cli_e2e.rs +0 -0
  41. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-py/Cargo.toml +0 -0
  42. {beancount_format-0.1.15 → beancount_format-0.1.16}/crates/beancount-formatter-py/src/lib.rs +0 -0
  43. {beancount_format-0.1.15 → beancount_format-0.1.16}/python/src/beancount_format/__init__.py +0 -0
  44. {beancount_format-0.1.15 → beancount_format-0.1.16}/python/src/beancount_format/beancount_format.pyi +0 -0
@@ -128,7 +128,7 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
128
128
 
129
129
  [[package]]
130
130
  name = "beancount-formatter"
131
- version = "0.1.15"
131
+ version = "0.1.16"
132
132
  dependencies = [
133
133
  "anyhow",
134
134
  "beancount-parser",
@@ -141,7 +141,7 @@ dependencies = [
141
141
 
142
142
  [[package]]
143
143
  name = "beancount-formatter-cli"
144
- version = "0.1.15"
144
+ version = "0.1.16"
145
145
  dependencies = [
146
146
  "anyhow",
147
147
  "assert_cmd",
@@ -155,7 +155,7 @@ dependencies = [
155
155
 
156
156
  [[package]]
157
157
  name = "beancount-formatter-py"
158
- version = "0.1.15"
158
+ version = "0.1.16"
159
159
  dependencies = [
160
160
  "beancount-formatter",
161
161
  "beancount-formatter-cli",
@@ -420,7 +420,7 @@ dependencies = [
420
420
 
421
421
  [[package]]
422
422
  name = "dprint-plugin-beancount"
423
- version = "0.1.15"
423
+ version = "0.1.16"
424
424
  dependencies = [
425
425
  "anyhow",
426
426
  "beancount-formatter",
@@ -1244,7 +1244,8 @@ dependencies = [
1244
1244
 
1245
1245
  [[package]]
1246
1246
  name = "tree-sitter-language"
1247
- version = "0.1.6"
1247
+ version = "0.1.7"
1248
+ source = "git+https://github.com/trim21/tree-sitter.git?rev=b714e2a7c01e8d5abab526f23e40b77c33babcb4#b714e2a7c01e8d5abab526f23e40b77c33babcb4"
1248
1249
 
1249
1250
  [[package]]
1250
1251
  name = "unicode-ident"
@@ -1278,9 +1279,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
1278
1279
 
1279
1280
  [[package]]
1280
1281
  name = "uuid"
1281
- version = "1.19.0"
1282
+ version = "1.20.0"
1282
1283
  source = "registry+https://github.com/rust-lang/crates.io-index"
1283
- checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
1284
+ checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f"
1284
1285
  dependencies = [
1285
1286
  "js-sys",
1286
1287
  "wasm-bindgen",
@@ -1421,18 +1422,18 @@ dependencies = [
1421
1422
 
1422
1423
  [[package]]
1423
1424
  name = "zerocopy"
1424
- version = "0.8.33"
1425
+ version = "0.8.34"
1425
1426
  source = "registry+https://github.com/rust-lang/crates.io-index"
1426
- checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
1427
+ checksum = "71ddd76bcebeed25db614f82bf31a9f4222d3fbba300e6fb6c00afa26cbd4d9d"
1427
1428
  dependencies = [
1428
1429
  "zerocopy-derive",
1429
1430
  ]
1430
1431
 
1431
1432
  [[package]]
1432
1433
  name = "zerocopy-derive"
1433
- version = "0.8.33"
1434
+ version = "0.8.34"
1434
1435
  source = "registry+https://github.com/rust-lang/crates.io-index"
1435
- checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
1436
+ checksum = "d8187381b52e32220d50b255276aa16a084ec0a9017a0ca2152a1f55c539758d"
1436
1437
  dependencies = [
1437
1438
  "proc-macro2",
1438
1439
  "quote",
@@ -1441,6 +1442,6 @@ dependencies = [
1441
1442
 
1442
1443
  [[package]]
1443
1444
  name = "zmij"
1444
- version = "1.0.16"
1445
+ version = "1.0.17"
1445
1446
  source = "registry+https://github.com/rust-lang/crates.io-index"
1446
- checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
1447
+ checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439"
@@ -3,7 +3,7 @@ members = ["crates/*"]
3
3
  resolver = "3"
4
4
 
5
5
  [workspace.package]
6
- version = "0.1.15"
6
+ version = "0.1.16"
7
7
  authors = ["Trim21 <trim21.me@gmail.com>"]
8
8
  edition = "2024"
9
9
  homepage = "https://github.com/trim21/beancount-format"
@@ -17,7 +17,8 @@ beancount-formatter = { path = "./crates/beancount-formatter/" }
17
17
  serde = { version = "1.0.228", features = ["derive"] }
18
18
 
19
19
  [patch.crates-io]
20
- tree-sitter-language = { path = "./patches/tree-sitter-language-0.1.6/" }
20
+ # tree-sitter-language = { path = "./patches/tree-sitter-language-0.1.6/" }
21
+ tree-sitter-language = { git = 'https://github.com/trim21/tree-sitter.git', rev = 'b714e2a7c01e8d5abab526f23e40b77c33babcb4' }
21
22
 
22
23
  [profile.release]
23
24
  opt-level = 3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beancount-format
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python
6
6
  Classifier: Programming Language :: Python :: 3
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
15
15
 
16
16
  # beancount-format
17
17
 
18
- Python package wrapping the Rust `dprint-plugin-beancount` formatter.
18
+ beancount formatter.
19
19
 
20
20
  ## Install
21
21
 
@@ -25,6 +25,14 @@ pip install beancount-format
25
25
 
26
26
  ## Usage
27
27
 
28
+ ### as CLI
29
+
30
+ ```bash
31
+ beancount-format ./
32
+ ```
33
+
34
+ ### as library
35
+
28
36
  ```python
29
37
  from bean_format import format_text
30
38
 
@@ -445,10 +445,7 @@ fn format_content(path: Option<&str>, content: &str, formatting_config: &Configu
445
445
  let path = path.unwrap_or("<memory>");
446
446
 
447
447
  if content.trim().is_empty() {
448
- return Ok(match formatting_config.new_line {
449
- NewLineKind::LF => "\n".to_string(),
450
- NewLineKind::CRLF => "\r\n".to_string(),
451
- });
448
+ return Ok(String::new());
452
449
  }
453
450
 
454
451
  // The parser expects a trailing newline; append one if it's missing.
@@ -156,12 +156,12 @@ fn format_empty_file_is_single_line() {
156
156
  ..Default::default()
157
157
  };
158
158
  let formatted_lf = format(Some("empty.bean"), "\n\n\t ", &config).expect("format failed");
159
- assert_eq!(formatted_lf, "\n");
159
+ assert_eq!(formatted_lf, "");
160
160
 
161
161
  let config = Configuration {
162
- new_line: NewLineKind::CRLF,
162
+ new_line: NewLineKind::LF,
163
163
  ..Default::default()
164
164
  };
165
165
  let formatted_crlf = format(Some("empty.bean"), " \r\n\r\n", &config).expect("format failed");
166
- assert_eq!(formatted_crlf, "\r\n");
166
+ assert_eq!(formatted_crlf, "");
167
167
  }
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "beancount-format"
7
- version = "0.1.15"
7
+ version = "0.1.16"
8
8
  description = "Beancount formatter powered by dprint-plugin-beancount"
9
9
  authors = [{ name = "trim21", email = "trim21.me@gmail.com" }]
10
10
  license = { file = "LICENSE" }
@@ -1,6 +1,6 @@
1
1
  # beancount-format
2
2
 
3
- Python package wrapping the Rust `dprint-plugin-beancount` formatter.
3
+ beancount formatter.
4
4
 
5
5
  ## Install
6
6
 
@@ -10,6 +10,14 @@ pip install beancount-format
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### as CLI
14
+
15
+ ```bash
16
+ beancount-format ./
17
+ ```
18
+
19
+ ### as library
20
+
13
21
  ```python
14
22
  from bean_format import format_text
15
23