bradyt / bradyt/cone

Goal: format is left inverse of parse on restricted transactions

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
formatting
Dominant language
Dart
Stars
25
Forks
8
PR merge metrics
No merged PRs in 30d

Description

This is sort of a vague idea right now. Briefly, we should have `format(parse(transaction)) == transaction`. In other words, our format function should be a left inverse of our parse function. At least for a restricted set of transaction strings, without comments, etc.

We might parse a ledger transaction, that is, a string from a ledger file, and then format that transaction and have the result be identical, in terms of indentation, decimal separator, column alignment, whether currency is on left or right, and whether there is spacing between number and currency.

Right now, this would at least require the external numberLocale, so maybe we can just allow for that for now, and leave it as a goal to remove that variable from the process.

This might also serve to motivate a good class definition for transaction that will work across the different parts of app. For example, whether currency is on left or right, might be a property of each posting.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing parse and format entry points and how the transaction class represents formatting details. Check how external numberLocale is used. Done means a restricted transaction string can be parsed and formatted back identically, preserving indentation, decimal separator, column alignment, currency placement, and spacing.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.