Commit graph

150 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
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
aeeec16984
Handle 'until' and 'recur' simiar to handling of 'gc' (#3753)
This centralizes updates to recurrence and 'until' in Command, instead
of doing so in each individual command implementation.

This is preparatory to opening the TaskChampion replica in read-only
mode.
2025-01-18 02:20:41 -05:00
Dustin J. Mitchell
c9967c20e2
Restore support for task info journal (#3671)
This support was removed before Taskwarrior-3.x, and is now restored,
including the original tests removed in
ddd367232e
2024-11-06 07:39:39 -05:00
Gagan Nagaraj
6a24510473
Exclude attributes starting with tag_ (#3619)
* Exclude attributes starting with tag_

* Check only for tag_*
2024-09-09 08:12:19 -04: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
Bernhard M. Wiedemann
603bf075f1
Fix issues with year 2038 (#3052)
* Fix annotations in year 2038

Fixes #3050

* Ensure 32-bit systems work better after 2038

Without this patch, their 32-bit signed long int could overflow.

This patch was done while working on reproducible builds for openSUSE.
2023-08-30 22:08:31 -04:00
Dustin J. Mitchell
ddd367232e [BREAKING] Remove journal.info support
This support will require access to all of the operations ever performed
on a task, which is not currently exposed by TaskChampion (but see #2928)
2023-04-16 19:21:14 -04:00
Dominik Rehák
8c3aa95224 CmdInfo: Fix leading spaces before urgency value
The minimal field width is set to 4, so if the value is shorter, it gets
prefixed with spaces, breaking the flow of the table.
2022-04-13 11:22:49 -04:00
Tomas Babej
dbf641988e
CmdTags: Update pointers to task enumeration lists 2021-10-02 21:38:47 -04:00
Tomas Babej
0bc92d6115
meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
Dustin J. Mitchell
309e99d49e Refactor task diffs to handle new attributes
This refactors task(Info)Differences to be methods of Task and to
correctly handle the `annotation_`, `tags_`, and `dep_` attributes.
2021-09-04 10:49:45 -04:00
Dustin J. Mitchell
20af583e21 Refactor to store dependencies as individual attributes
This also drops support for the transitional `json.depends.array`
configuration value, which has not been necessary since ~2016.

As with tags, dependencies are stored in both a "combined",
comma-separated format (for compatibility) and in an
attribute-per-dependency format (for the future).
2021-08-17 20:36:54 -04:00
Dustin J. Mitchell
413b8d22b7 Remove references to the 'depends' property outside of Task.cpp
With the exception of `taskDifferences` and `taskInfoDifferences`,
deferred to #2572.
2021-08-17 20:36:54 -04:00
Dustin J. Mitchell
20041c120e Refactor to store tags as individual attributes
Each tag is stored as `tag_<tagname>: x`.  The `x` is required because
empty attributes are treated as nonexistent.

For compatibility, the `tags` attribute is updated in sync with the
per-tag attributes.  This compatibility support may be dropped in later
versions.

Note that synchronization _updates_ use JSON format, which does not
change with this patch, and thus no compatibility issues exist.  The
synchronization _initialization_, however, uses FF4, meaning that a
sync server initialized from a version of `task` with this patch will
contain `tag_<tagname>` attributes, which will look like orphaned UDAs
to older versions.  However, as updates to tasks are synchronized via
the sync server, the updates will not contain these attributes and they
will show as "deleted" in the `task info` display on the older version.
Aside from the noise in the `task info` output, this is harmless.
2021-08-05 02:11:27 -04:00
Scott Mcdermott
607baa081d CmdInfo: fix missing spaces causing run-on in virtual tag list
without the fix, when listing out the tags we would see output like:

    Virtual tags  PENDING PROJECTREADY TAGGED UDA UNBLOCKED

there isn't a PROJECTREADY tag of course, but rather a missing space
2021-07-23 17:07:11 -04:00
Vladyslav Tronko
af6f2b55ec Fix matching project name during urgency calculation 2021-07-17 16:21:59 -04:00
Rosen Penev
8ffb85b327 clang-tidy: use '' for single character find
Found with performance-faster-string-find

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-22 23:18:16 -04:00
Tomas Babej
9017cd6e53
doc: Update copyright to 2021 2021-01-02 02:48:22 -05:00
Tomas Babej
6ff63286b5
CmdInfo: Properly format date and duration UDAs
The 'type' variable was never assigned value, hence the checking for
'date' and/or 'duration' always failed. Use col->type() instead.

Closes #2060.
2020-12-28 20:36:32 -05:00
Max Rossmannek
3d850715f4 Make virtual tags consistent across commands.
- the DUETODAY tag was deprecated in b2d49f397
- the QUARTER tag was added in 630a1530e and 4711dd9e1
- the PROJECT, PRIORITY and LATEST tags were added in 4008a64

Note: the documentation in the man page is already up-to-date.

Fixes #2359
2020-12-03 01:45:07 -05:00
Tomas Babej
a09f9d48ab Update copyright to 2020 2020-11-21 12:27:05 -05:00
mrossinek
6fbd400e77 Fix #1999 2019-03-02 19:44:18 -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
865e277b76 l10n: Eliminated some column labels 2018-01-21 22:32:17 -05:00
Paul Beckingham
611d09cb16 l10n: Eliminated some column labels 2018-01-21 22:18:18 -05:00
Paul Beckingham
957b769412 l10n: Eliminated some column labels 2018-01-21 22:15:26 -05:00
Paul Beckingham
5335512c38 l10n: Eliminated some column labels 2018-01-21 22:11:25 -05:00
Paul Beckingham
a6c4c2fb2a l10n: Eliminated some column labels 2018-01-21 22:09:51 -05:00
Paul Beckingham
6c1a411d7e l10n: Eliminated some column labels 2018-01-21 22:07:57 -05:00
Paul Beckingham
64f2436d87 l10n: Eliminated STRING_COLUMN_LABEL_DESC 2018-01-21 13:15:20 -05:00
Paul Beckingham
2d859aa048 l10n: Eliminated STRING_CMD_INFO_* 2018-01-21 12:21:42 -05:00
Paul Beckingham
cf56983b58 l10n: Eliminated STRING_COLUMN_LABEL_ID 2018-01-20 14:44:01 -05:00
Paul Beckingham
2605cfa227 l10n: Eliminated STRING_COLUMN_LABEL_TEMPLATE 2018-01-15 13:35:38 -05:00
Paul Beckingham
367f3a5e32 l10n: Eliminated STRING_COLUMN_LABEL_PARENT 2018-01-15 12:24:57 -05:00
Paul Beckingham
193eebd852 l10n removal of STRING_COLUMN_LABEL_MASK, STRING_COLUMN_LABEL_MASK_IDX 2018-01-07 13:37:47 -05:00
Paul Beckingham
0de169bb10 Copyright 2018 2017-12-31 19:22:07 -05:00
Paul Beckingham
043884fc9b CmdInfo: Table headers consistent 2017-03-20 09:11:00 -04:00
Paul Beckingham
218b43ecfa CmdInfo: Fixed header underline problem 2017-03-20 08:29:51 -04:00
Paul Beckingham
440cfb009e CmdTimesheet: Rewrote the command
- Updated the 'timesheet' command with a more compact report that accepts a
  filter, and has a default filter showing the last four weeks of completed and
  started tasks.
2017-02-09 08:19:30 -05:00
Paul Beckingham
a95dddd00c CmdInfo: Code cleanup 2017-01-29 12:22:35 -05:00
Paul Beckingham
4e7576cb79 Merge branch 'recurrence' into 2.6.0 2017-01-07 12:29:11 -05:00
Paul Beckingham
fd4ca47581 CmdInfo: Added TEMPLATE and INSTANCE virtual tags 2017-01-07 12:04:13 -05:00
Paul Beckingham
a50e65a134 Copyright update 2017-01-01 12:30:04 -05:00
Paul Beckingham
b0a4a409a6 Task: Improved method signature 2016-12-31 16:33:39 -05:00
Paul Beckingham
5193f7d03e Task: Improved method signature 2016-12-31 15:55:06 -05:00