Files
todotxt2remind/test.todo.txt
Paolo Donadeo 096216579d fix(parser): warn instead of silently dropping tasks with invalid due dates
A malformed due: value (e.g. due:2024-13-99) left DueDate nil, causing
ToRemind to silently emit nothing for that task. Now ParseLine reports
an error so the problem surfaces on stderr instead of vanishing.

Also fixes staticcheck QF1012 (WriteString(Sprintf(...)) -> Fprintf)
flagged by the IDE in ToRemind.
2026-07-09 23:55:18 +02:00

94 lines
2.1 KiB
Plaintext

# Valid tasks
(A) Call Mom +Family @phone
(B) Schedule Goodwill pickup +GarageSale @phone
Post signs around the neighborhood +GarageSale
@GroceryStore pies
2011-03-02 Document +TodoTxt task format
(A) 2011-03-02 Call Mom
x 2011-03-03 Call Mom
x 2011-03-02 2011-03-01 Review Tim's pull request +TodoTxtTouch @github
(A) Call Mom due:2024-12-31
x 2024-11-24 2024-11-20 Finish project due:2024-12-01 +Work @office
# Valid metadata
Buy milk due:2024-12-01
Do taxes taxyear:2024
Plan trip location:Rome
# Valid multiple projects/contexts
(A) Call Mom +Family +PeaceLoveAndHappiness @iphone @phone
# Borderline: priority not at start
Really gotta call Mom (A) @phone @someday
(B)->Submit TPS report
(b) Get back to the boss
# Borderline: creation date not at start
(A) Call Mom 2011-03-02
# Borderline: completed but missing completion date (should error)
x Call Mom
# Borderline: project/context with only symbol
Do something +
Do something @
# Borderline: key:value with protocol as key (should NOT be metadata)
http://example.com
https://example.com
ftp://server.com
mailto:someone@example.com
# Borderline: key:value with protocol as key (should NOT be metadata)
http:example.com
https:example.com
ftp:server.com
mailto:someone@example.com
# Borderline: key:value with value as URL (should be metadata)
link:http://example.com
website:https://example.com
# Borderline: key:value with spaces (should NOT be metadata)
foo:bar baz
foo :bar
foo: bar
# Borderline: key:value with multiple colons (only first is split)
multi:colon:example
# Borderline: empty line
# Malformed: priority with lowercase letter
(a) Call Mom
# Malformed: completed with uppercase X
X 2012-01-01 Make resolutions
# Malformed: completed with x not at start
(A) x Find ticket prices
# Malformed: date with invalid format
(A) 2024-13-99 Call Mom
x 2024-99-99 Call Mom
# Malformed: due date with invalid format (should error, task dropped from output)
(A) Call Mom due:2024-13-99
# Malformed: key:value with whitespace in key or value
foo bar:baz
foo:bar baz
foo:bar:baz
# Malformed: only symbols
+
@
:
# Malformed: random text
Just a random line with no special tokens
# Malformed: only spaces