summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* use sha1sum in anonymize_posts::operator()dbear4962024-09-162-15/+3
|
* promote compatability with Boost <1.86.0dbear4962024-09-162-18/+28
|
* update to Boost 1.86.0dbear4962024-09-162-8/+8
| | | | fixes #2378
* chore(deps): bump cachix/install-nix-action from V27 to 28dependabot[bot]2024-09-121-1/+1
| | | | | | | | | | | | | Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V27 to 28. This release includes the previously tagged commit. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/V27...V28) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* Avoid string in amount_t::in_place_truncateMax Nikulin2024-08-151-26/+1
| | | | | Do not serialize to string just to get rounded value. `in_place_roundto` should be reliable enough now.
* add unittest for #ledger/2348Tavis Ormandy2024-08-081-0/+16
|
* disable checking for generated transactionsTavis Ormandy2024-08-081-0/+3
| | | | | | | | | There is no parse_context_stack for generated transactions, because they were not parsed from anywhere. This breaks strict checking, because errors can't be reported. It doesn't make sense to report errors for these anyway, so lets just disable them.
* fix use-after-free with regex_match()Tavis Ormandy2024-08-081-4/+4
| | | | | | The smatch does not copy the input, it points to the original. So if the string is on the stack and goes out of scope because it's only used as a parameter, it will just be junk. Make a copy of it at a higher scope.
* Add doc for account, display_account and account_base variablesmatclab2024-08-071-0/+21
|
* More unit tests for amount_t::roundtoMax Nikulin2024-08-072-3/+15
| | | | | - Add some tests from comments to pull request #2361. - Fix decimal separator in earlier added tests.
* Add Python bindings for roundtoMax Nikulin2024-08-073-0/+10
| | | | | | | | | Expose `roundto` and `in_place_roundto` to `Amount`, `Balance`, and `Value` Python classes. They may be handy for debugging. The methods were added after introducing of bindings and likely it is a reason why they were missed. Closes: #2365
* Revert "also copy costs that round to zero"dbear4962024-08-061-1/+1
| | | | | | This reverts commit e2f64be216506b51c029147982f1addc50f4c745. post->cost is actually of type optional, so the cast to bool iscorrect.
* also copy costs that round to zerodbear4962024-08-061-1/+1
|
* copy cost from automatic transaction postingdbear4962024-08-061-0/+2
| | | | fixes #2268
* add regress test for #2268dbear4962024-08-061-0/+13
|
* Avoid ctype abuse.Taylor R Campbell2024-08-0613-47/+76
| | | | | fix https://github.com/ledger/ledger/issues/2338 fix https://github.com/ledger/ledger/issues/2340
* Add new --align-intervals option.Ian20202024-08-0610-19/+347
|
* Fix copy on write for amount_t::in_place_roundtoMax Nikulin2024-08-064-28/+10
| | | | | | | | | | | | - Copy amount quantity before rounding. - Fix `amount_t::roundto(int)`. - Transform `balance/testRound` into `balance/testRoundto`. It was a mix of `round` and `roundto` operation with unclear purpose and was relying on `in_place_roundto` behavior modifying all copies. There is no unit tests for balance `round` and `unround` any more. Closes #2362
* Another whitespace changeJohn Wiegley2024-08-051-1/+1
|
* Add whitespace to xact_t::hashJohn Wiegley2024-08-051-0/+8
|
* Rename SHA-512/256 to the more appropriate SHA-512HalfJohn Wiegley2024-08-055-7/+7
|
* Add two missing system headers to sha512.ccJohn Wiegley2024-08-051-0/+2
|
* Revert all changes to sha512.cJohn Wiegley2024-08-051-1/+1
|
* Change one prototypeJohn Wiegley2024-08-051-3/+1
|
* Remove most changes to sha512.ccJohn Wiegley2024-08-051-5/+11
|
* Include sys/types.hJohn Wiegley2024-08-051-0/+1
|
* Include stdint.h in sha512.ccJohn Wiegley2024-08-051-0/+1
|
* Fix return type of SHA512John Wiegley2024-08-051-1/+1
|
* Try something elseJohn Wiegley2024-08-051-7/+1
|
* Revert a type changeJohn Wiegley2024-08-051-2/+2
|
* Type signature fixJohn Wiegley2024-08-051-1/+1
|
* Minor doc updateJohn Wiegley2024-08-051-1/+1
|
* Update src/sha512.ccJohn Wiegley2024-08-051-1/+1
| | | Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
* Update src/sha512.ccJohn Wiegley2024-08-051-1/+1
| | | Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
* Update doc/ledger.1John Wiegley2024-08-051-1/+1
| | | Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
* Update doc/ledger.1John Wiegley2024-08-051-1/+1
| | | Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
* Add support for --hashes=sha512_256 as another algorithmJohn Wiegley2024-08-0514-28/+81
|
* Add further documentation on the --hashes optionJohn Wiegley2024-08-051-13/+40
|
* Improvements to the hashing testsJohn Wiegley2024-08-053-4/+36
|
* Make xact hashes independent of posting orderJohn Wiegley2024-08-058-40/+50
| | | | | Also, support matching provided hashes against a prefixed of the generated hash.
* Add documentation for the --hashes optionJohn Wiegley2024-08-052-1/+21
|
* Add positive and negative tests for the --hashes optionJohn Wiegley2024-08-052-0/+51
|
* --hashes option requires an argument to specify the algorithmJohn Wiegley2024-08-052-6/+21
| | | | | At the moment only "sha512" or "SHA512" is accepted, but this could extend to more algorithms in the future.
* Add support for hash chaining to detect modifications in postingsJohn Wiegley2024-08-0515-28/+592
| | | | | | | | | | | | | | | | | | | The following details of a posting contribute to its hash: fullname of account string representation of amount Each posting hashes contributes to the transaction hash, which is compromised of: previous transaction’s hash (as encountered in parsing order) actual date optional auxiliary date optional code payee hashes of all postings Note that this means that changes in the “code” or any of the comments
* Fix denominator of roundto resultMax Nikulin2024-08-055-3/+145
| | | | | | | | | | | | | | | | | | Multiprecision rational created from a double value may have large power of 2 denominator since fractional decimal numbers can not be represented as binary floating point numbers. It leads to failed assertion when result is compared to a value converted directly from strings. Use integer multiprecision arithmetics to round numbers to ensure proper denominator. Inspired by python gmpy2 package <https://github.com/aleaxit/gmpy/blob/3e4564ae9d/src/gmpy2_mpq_misc.c#L315> The change makes `roundto` symmetric for positive/negative arguments. Halves are rounded to nearest even. Rounded away from zero are discussed in #1663 and it may be achieved with minimal modification. - See #2329 - Closes #1983
* Merge pull request #2367 from Chris927/masterAlexis Hildebrandt2024-07-241-1/+1
|\
| * Fix acprep scriptChris Oloff2024-07-241-1/+1
|/ | | | | | | | | The script has a syntax error, caused by commit 815305b9: in escape_string() function the first argument to re.sub() was probably changed unintentionally. This reverts this one line. To test, I used acprep to build the binary locally, which succeeded. More testing might be needed, I don't have enough context to do that.
* Use https scheme for links in CONTRIBUTING.mdAlexis Hildebrandt2024-07-101-12/+12
| | | | [ci skip]
* print: Align amounts even when account names are longGwyneth Morgan2024-07-102-30/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the account name is longer than the --account-width (default 36), the amounts stop aligning: 2023/01/01 Transaction with long account names Assets:Very:Long:Account:Name:That:Will:Push:The:Amount -10 ABC Assets:Another:Long:Account:Name:That:Will:Push:The:Amount -10 ABC Expenses:Short 20 ABC One can set a larger --account-width, but that is not a great solution for cases where you have only a few accounts with problematically long names. Instead, keep the current account width wherever possible, but when an account name is longer than the account width, account for that and still align the values: 2023/01/01 Transaction with short account names Assets:Short -10 ABC Assets:Short -10 ABC Expenses:Short 20 ABC 2023/01/01 Transaction with long account names Assets:Very:Long:Account:Name:That:Will:Push:The:Amount -10 ABC Assets:Another:Long:Account:Name:That:Will:Push:The:Amount -10 ABC Expenses:Short 20 ABC This is similar to hledger's behavior.
* cmake: Clean up add_ledger_library_dependencies macroAlexis Hildebrandt2024-07-081-9/+7
|