Commit graph

137 commits

Author SHA1 Message Date
Tobias Predel
81ca04fc8c
Declare in corresponding header files and dissolve main.h (#3796)
* Declare in corresponding header files and dissolve main.h

Apply include-what-you-use

* Remove further unncessary includes

* Incorporate review comment

* Do not declare static functions and variables in header

* Adapt test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-01 14:47:42 -05:00
Tobias Predel
55c02f5420
Remove unused includes (#3795)
* Remove unused include in Variant.h

* Remove unused include in util.h

* Remove unused include directives in util.cpp

* Remove unused include directives in TF2.h

* Remove unused include directives in TF2.cpp

* Remove unused include directive in TDB2.h

* Remove unused include directives in TDB2.cpp

* Remove unused include directives in Task.h

* Remove unused include directive in rules.cpp

* Remove unused include directives in rules.cpp

* Remove unused include directives in nag.cpp

* Remove unused include directive in main.h

* Remove unused include directive in legacy.cpph

* Remove unused include directive in Hooks.cpp

* Remove unused include directive in Filter.h

* Remove unused include directive in Filter.cpp

* Remove unused include directive in feedback.cpp

* Remove unused include directive in Eval.cpp

* Remove unused include directives in dependency.cpp

* Remove unused include directivess in Context.cpp
2025-03-01 10:42:40 -05:00
Dustin J. Mitchell
fdb7e5e020
Test for unusual task data (#3770)
* Test for unusual task data

A task might have any combination of keys and values, but Taskwarrior
often assumes that only valid values can occur, and crashes otherwise.
This is highly inconvenient, as it's often impossible to do anything
with the invalid task -- Taskwarrior just fails without modifying it.

So, this is the beginning of some testing for such invalid tasks, with
the goal of making Taskwarrior due something reasonable. In general, an
invalid attribute value is treated as if it was not set. This is not
exhaustive, and there are likely still bugs of this sort, but as we find
them we can fix and add regression tests to this script.

This introduces a new test-only binary that creates a "bare" task using
TaskChampion, avoiding Taskwarrior's efforts to not create "unusual"
tasks.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-05 08:20:35 -05:00
Dustin J. Mitchell
4797c4e17e
Check Datetime addition when performing recurrence (#3708) 2024-11-29 09:12:20 -05:00
Felix Schurk
93356b39c3 add initial bulk run from pre-commit over all files 2024-07-29 22:34:51 +02:00
Felix Schurk
954d3f5058 add blank line between cmake.h header include to prevent sorting
* add required comment in the line below cmake.h include header
2024-07-29 22:33:17 +02:00
Dustin J. Mitchell
d4649dd210
Revert "Do not create recurring tasks before today (#3542)" (#3555)
This reverts commit 6d3519419e.
2024-07-13 19:12:49 -04:00
Dustin J. Mitchell
6d3519419e
Do not create recurring tasks before today (#3542)
Tasks can be due "today", as `task add foo due:today ..` is a common
form. However, recurrences before that are just not created.

This avoids a lengthy "hang" when recurrences are updated on an old task
database, as many tasks in the past are created.
2024-07-07 08:51:09 -04:00
Dustin J. Mitchell
5bb9857984 Use Taskchampion to store Taskwarrior data
This replaces the TF2 task files with a TaskChampion replica.
2023-06-11 17:37:03 -04:00
Dustin J. Mitchell
271d06cd9c make TDB2.pending/completed non-public
References to methods on these fields are replaced with methods on TDB2,
several of which already existed.
2022-07-24 14:18:21 -04:00
Tomas Babej
0bc92d6115
meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
Tomas Babej
34ffd164bb
recur: Remove references to the new recurrence mechanism 2021-06-12 10:40:29 -04:00
Tomas Babej
4db7990df8
recur: Remove WIP recurrence overhaul implementation
The feature has been moved to 3.0 milestone. Also, we are now using
feature branches for development of new functionality, in order to make
the development branch more stable.
2021-06-12 10:37:23 -04:00
Tomas Babej
9017cd6e53
doc: Update copyright to 2021 2021-01-02 02:48:22 -05:00
Tomas Babej
fcfe01f301
recur: Prevent infinite loops with 0 periods
Specifying a recurrence interval that amounts to a zero, like 'P0M', 0q
or 0m causes task to fall into an infinite loop when trying to determine
next recurrence dates.

Detect scenarios with zero-length recurrence interval and throw an
exception.

Closes #2262.
2020-12-06 20:58:26 -05:00
Paul Beckingham
3e0a428185 Revert "[clang-tidy] Use .empty instead of comparing size"
This reverts commit a331cceded.
2020-12-05 16:18:37 -05:00
Paul Beckingham
5502729131 Revert "[clang-tidy] Switch C headers to C++ ones"
This reverts commit 0344856d65.
2020-12-05 16:18:37 -05:00
Paul Beckingham
364b4ea8bd Revert "[clang-tidy] Simplify boolean expressions"
This reverts commit 51870dff34.
2020-12-05 16:18:37 -05:00
Rosen Penev
51870dff34 [clang-tidy] Simplify boolean expressions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-05 15:03:43 -05:00
Rosen Penev
0344856d65 [clang-tidy] Switch C headers to C++ ones
Found using modernize-return-braced-init-list

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-05 15:03:43 -05:00
Rosen Penev
a331cceded [clang-tidy] Use .empty instead of comparing size
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-05 15:03:43 -05:00
Tomas Babej
a09f9d48ab Update copyright to 2020 2020-11-21 12:27:05 -05:00
Michał Mirosław
7b2e68d176 Fix parsing of "PnM" recurrence periods
Due to not accounting for the leading "P", getNextRecurrence would always return the same datetime, breaking all generic "PnM" periods and leading to an infinite loop in generateDueDates.
2020-11-17 10:52:47 -05:00
Tomas Babej
8066e4e6e2 meta: Update copyright year 2019-01-01 08:46:21 -05:00
Kirill Bobyrev
5cdbe6d019
Use nullptr instead lf C-styled NULL 2018-03-07 22:21:28 +03:00
Simon Ruderich
e817dfc800 Always use https:// link for opensource.org
It was already used in a few places, make this consistent.
2018-03-04 14:53:07 +01:00
Mark Scannell
7af6db4c17 Portability: Updated to make main re-entrant()
- New INSTALL instructions to emscripten, and AUTHORS for contribution.
2018-01-31 19:45:07 -05:00
Paul Beckingham
cae3f06b7d Lexer: Migrated to unicodeLatinDigit 2018-01-25 01:08:26 -05:00
Paul Beckingham
016bb94d3f l10n: Eliminated i18n.h 2018-01-21 23:29:59 -05:00
Paul Beckingham
6bd9c46c8c l10n: Eliminated STRING_RECUR_CREATE 2018-01-17 21:19:11 -05:00
Paul Beckingham
3e3ed5446c l10n: Eliminated STRING_TASK_VALID_RECUR 2018-01-17 21:16:20 -05:00
Paul Beckingham
0de169bb10 Copyright 2018 2017-12-31 19:22:07 -05:00
Paul Beckingham
ce012d6430 Recur: Typo 2017-07-22 13:29:26 +01:00
Paul Beckingham
97b038ce29 Recurrence: Broke out handleUntil as a separate function
- This means until porocesing is no longer controlled by rc.recurrence, which
  was never intended.
2017-04-06 00:29:20 -04:00
Paul Beckingham
2810c70223 Recurrence: Stubbed synthesizeTasks 2017-04-01 14:25:56 -04:00
Paul Beckingham
b40cc89235 Recurrence: Added stub for handleRecurrence2 2017-03-31 08:38:35 -04:00
Paul Beckingham
f6f79d28ee Recurrence: Relocate nag function out of the way 2017-03-31 08:34:25 -04:00
Paul Beckingham
19c18b04aa recur: Code cleanup 2017-01-26 19:56:13 -05:00
Paul Beckingham
2da0656b5e recur: Code cleanup 2017-01-26 19:56:07 -05:00
Paul Beckingham
81e3d3bb42 recur: Code cleanup 2017-01-26 19:55:59 -05:00
Paul Beckingham
e2633a2d76 recur: Code cleanup 2017-01-26 19:55:51 -05:00
Paul Beckingham
223ca89d73 recur: Code cleanup 2017-01-26 19:55:43 -05:00
Paul Beckingham
5fd6f716a6 recur: Code cleanup 2017-01-26 19:55:34 -05:00
Paul Beckingham
a50e65a134 Copyright update 2017-01-01 12:30:04 -05:00
Paul Beckingham
5ec4b5ebc9 recur: Migrated from ISO8601d to Datetime 2016-12-17 22:36:29 -05:00
Paul Beckingham
8a3af0c4a6 recur: Converted from ISO8601p to Duration 2016-12-11 21:32:41 -05:00
Paul Beckingham
355620c640 libhsared: migrating from local to libshared 2016-12-06 07:20:45 -05:00
Paul Beckingham
2d20f4d57b Cleanup: Converted all sprintf to snprintf 2016-02-25 00:19:38 -05:00
Paul Beckingham
641d232dea Copyright: Updated to 2016 2015-12-31 15:06:43 -05:00
Paul Beckingham
8e778712ea TW-1313: some recurring intervals reset due time to midnight
- Thanks to James Dietrich.
2015-11-07 17:12:25 -05:00