Repository navigation
Closed
Labels
A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.Something wrong, confusing or sub-standard in the software, docs, or user experience.affects4-manyAffects potentially a significant number of users.Affects potentially a significant number of users.annoyance4-majorMajor usability/doc bug, or any regression or crash.Major usability/doc bug, or any regression or crash.bountyThar's some kind o' loot on offer..Thar's some kind o' loot on offer..csvThe csv file format, csv output format, or generally CSV-related.The csv file format, csv output format, or generally CSV-related.docsDocumentation-related.Documentation-related.regressionA backwards step, indicating a weakness in our QA. We don't like these.A backwards step, indicating a weakness in our QA. We don't like these.
Description
& in the regex expression of an if block raises error on CSV import unless the & is followed by a conditional block. Escaping with backslashes or enclosing & in a regex group expression (e.g., [ \&]*) has no effect.
Example CSV rule file
if
%description STOP \& SHOP
account2 Expenses:Food and Supplies
Error Output
hledger: Error: ...chase-visa.rules:137:21:
|
137 | %description STOP \& SHOP
| ^
unexpected space
expecting conditional block
I'm using hledger-flow import and hledger 1.42, mac-aarch64. I did not have this error prior to 1.42.
Metadata
Metadata
Assignees
Labels
A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.Something wrong, confusing or sub-standard in the software, docs, or user experience.affects4-manyAffects potentially a significant number of users.Affects potentially a significant number of users.annoyance4-majorMajor usability/doc bug, or any regression or crash.Major usability/doc bug, or any regression or crash.bountyThar's some kind o' loot on offer..Thar's some kind o' loot on offer..csvThe csv file format, csv output format, or generally CSV-related.The csv file format, csv output format, or generally CSV-related.docsDocumentation-related.Documentation-related.regressionA backwards step, indicating a weakness in our QA. We don't like these.A backwards step, indicating a weakness in our QA. We don't like these.
Activity
adept commentedon Mar 11, 2025
A very quick workaround is to replace it with "." (which you probably know, but I wanted to mention it anyway)
gassmatt commentedon Mar 11, 2025
simonmichael commentedon Mar 11, 2025
Sorry for breaking your rules!
I guess this is due to #2333, even though we tried to avoid breaking rules with &. @thomie would you have time to investigate ?
simonmichael commentedon Mar 11, 2025
@gassmatt claim your https://hledger.org/REGRESSIONS.html#regression-finder-bounty when ready, the first of 1.42.
[-]unescapable & in CSV rules[/-][+]1.42: & in CSV rules broke, unescapable[/+][-]1.42: & in CSV rules broke, unescapable[/-][+]1.42: & in CSV rules no longer works, unescapable[/+]thomie commentedon Mar 11, 2025
I will have a look tomorrow.
fix: csv: properly parse & in rules (hledgerorg#2352)
fix: csv: fix regression in parsing rules containing & (hledgerorg#2352)
thomie commentedon Mar 12, 2025
Sorry about that! The fix is easy enough, but I should have caught this earlier. Pull request in #2353.
simonmichael commentedon Mar 12, 2025
@gassmatt, would you be able to confirm the fix works for you ? It's in the binaries at https://github.com/simonmichael/hledger/releases/tag/nightly .
11 remaining items
[-]1.42: & in CSV if rules no longer works[/-][+]1.42 regression: & in CSV if rules no longer works[/+][-]1.42 regression: & in CSV if rules no longer works[/-][+]1.42 regression: csv: & in if rules no longer works[/+][-]1.42 regression: csv: & in if rules no longer works[/-][+]1.42 regression: csv: if rules: & within match patterns broke[/+][-]1.42 regression: csv: if rules: & within match patterns broke[/-][+]1.42 regression: csv: & within if rule regexps broke[/+][-]1.42 regression: csv: & within if rule regexps broke[/-][+]1.42 regression: csv: & within `if` rule regexps broke[/+][-]1.42 regression: csv: & within `if` rule regexps broke[/-][+]1.42 regression: csv: `&` within `if` rule regexps broke[/+][-]1.42 regression: csv: `&` within `if` rule regexps broke[/-][+]1.42: csv: `&` within `if` rule regexps broke[/+][-]1.42: csv: `&` within `if` rule regexps broke[/-][+]1.42-1.42.1: csv: `&` within `if` rule regexps broke[/+][-]1.42-1.42.1: csv: `&` within `if` rule regexps broke[/-][+]1.42: csv: `&` within `if` rule regexps broke[/+][-]1.42: csv: `&` within `if` rule regexps broke[/-][+]1.42: `&` in CSV `if` rules broke[/+]