Skip to content

Commit

Permalink
xcheck: ignore balance assertions from non-matching accounts
Browse files Browse the repository at this point in the history
When using the xcheck plugin, currently, all balance assertions are copied over, even if a list of accounts is specified. This leads to errors if not all accounts used in balance assertions exist in both files.

This PR changes that behavior and only copies over balance assertions that match one of the specified accounts (in case accounts are specified)
  • Loading branch information
carposio authored and SEIAROTg committed May 10, 2024
1 parent 9f7fcc8 commit 9afa48b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autobean/xcheck/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def handle_xcheck(self, entry: Custom, path: str, start: datetime.date, *account
))
self._includes.add(path)
for stmt_entry in stmt_entries:
if isinstance(stmt_entry, Balance):
if isinstance(stmt_entry, Balance) and (not accounts or stmt_entry.account in accounts):
yield stmt_entry
yield entry

Expand Down

0 comments on commit 9afa48b

Please sign in to comment.