Commit graph

5963 commits

Author SHA1 Message Date
DanielMowitz
1d804ae7c8 Implemented non-cumulative burndown reports and added a test for them. 2021-09-11 13:56:03 -04:00
Tomas Babej
0bc92d6115
meta: Adjust copyright headers 2021-09-05 12:02:07 -04:00
Tomas Babej
2bd0d8ebd3 Task: Make sure tag and dependency attributes are not identified as orphan UDAs 2021-09-04 11:15:37 -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
Tomas Babej
7aee9567a3
Task: Fix extra whitespace typo 2021-09-03 21:15:07 -04:00
Tomas Babej
99f4929dc5
CmdExport: Throw an exception when the report is not found
The Context::getContext ().error only issues a log message, but allows
the execution of the program. In order to interrupt the execution, an
exception must be raised.
2021-08-31 18:27:45 -04:00
Dheepak Krishnamurthy
9ce366ddab task <filter> export [<report>] 2021-08-29 12:48:18 -04:00
Tomas Babej
d91e30ee13
Merge branch '2.6.0' into getFromContext 2021-08-28 23:53:40 -04:00
Tomas Babej
8b30046d0a CLI2: Simplify code by using const quote string
The "\'" string is equal to "'", which is already stored in the quote
variable, so we might as well use that.

Thanks to Sebastian Uharek for the review suggestion.
2021-08-28 21:01:29 -04:00
Tomas Babej
ddf2f122a2 CLI2: Pre-reserve the size of the escaped string 2021-08-28 21:01:29 -04:00
Tomas Babej
c119b6d1de CLI2: Support escaped utf-8 characters 2021-08-28 21:01:29 -04:00
sebu06
0523ada9fc Fixed bug with double escaped single quotes
Before, the parser always escaped single quotes, independent of the quotes being escaped already. This is now fixed.
2021-08-28 21:01:29 -04:00
Bharatvaj H
05904549a0 Fixes #2580
Check annotations field before parsing

Add test case for annotations
2021-08-21 08:28:43 -04:00
Tomas Babej
8cad6487c7 CLI2: Call uses_context from child classes, if applicable 2021-08-21 08:25:06 -04:00
Tomas Babej
21f1086f3d Context: Add default values for report.<name>.context variables 2021-08-21 08:25:06 -04:00
Tomas Babej
5309132add CmdTimesheet: Add ability to specify if context should be used
This makes timesheet consistent with other report commands.
2021-08-21 08:25:06 -04:00
Tomas Babej
ab29ef8326 CmdCustom: Respect report.<name>.context configuration variable
This allows the user to configure if a specific report should (or should
not) adhere to the currently active context.

Closes #2560.
2021-08-21 08:25:06 -04:00
Tomas Babej
a464324617 CmdConfig: Properly preserve comments at the end of the line
Trailing comments previously caused crash of the application.

Closes #2581.
2021-08-21 01:06:55 -04:00
Tomas Babej
e2e184b8d4 CmdConfig: Be more strict when matching confiuration variables
Allow only leading spaces in front of configuration variables, as
opposed to arbitrary strings.

This prevents matching variables like "report.list.context=" when one is
seeking to modify "context=".
2021-08-21 01:06:55 -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
Tomas Babej
89a6f2b629 CLI2: Apply UUID/ID context break only for readable context
The purpose of this break is to not apply the context on commands like

    task 4 info

so that we can still refer to tasks directly (using their ID/UUID
references) even if they fall outside of the currectly active context.

However, this break should not be applied for writeable context. This is
because the lexer can (a bit misleadingly) label parts of the desription
of the new task as number/identifier tokens

   task add Replace 3 parts of the puzzle abc123
                    ^                     ^
                    type::number          type:uuid

which would trigger the break unnecessarily.

Closes #2550.
2021-08-15 22:50:55 -04:00
Dustin J. Mitchell
9a9ede7878 update built-in reports to use +WAITING, and doc 2021-08-08 14:27:25 -04:00
Tomas Babej
f8ca8cff81 Task: Make COMPLETED and DELETED virtual tags use getStatus()
This is now consistent with how PENDING is defined since recent commit
520d7e979b.
2021-08-08 14:27:25 -04:00
Tomas Babej
91517151ad docs: Add removal comments 2021-08-08 14:27:25 -04:00
Tomas Babej
861e8a6414 commands: Do not remove wait attribute upon task completion/deletion 2021-08-08 14:27:25 -04:00
Tomas Babej
ea008380db Task: Use getStatus () call to determine if task is pending 2021-08-08 14:27:25 -04:00
Tomas Babej
582bee66e9 DOM: Implement special-cased status handling
This is required for status:pending filters not matching the tasks with
the virutal waiting tag.
2021-08-08 14:27:25 -04:00
Tomas Babej
db324c41e3 TF2: Upgrade waiting tasks to pending, if applicable
This can be safely removed in one of the later releases (likely 3.1 or
later).
2021-08-08 14:27:25 -04:00
Dustin J. Mitchell
901283c79f [WIP] make 'waiting' status a 'virtual' status 2021-08-08 14:27:25 -04:00
sebu06
1d81e5e3ee Configuration override of settings for context
Every configuration parameter can be overwritten for the
current context by setting the parameter:

context.<name>.rc.<parameter> = <value>

in the config file. This allows for example to set a custom
report for each context.
2021-08-05 13:22:17 +02: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
Rosen Penev
17e6257e07 more emplace
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-05 02:03:59 -04:00
Rosen Penev
5c137f5c8f use emplace
Allows removing the constructor name as emplace forwards the arguments
directly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-05 02:03:59 -04:00
Korrat
b33a99a748 Nag based on task state before modification
With this patch, taskwarrior uses the urgency of tasks before any
modifications are applied when deciding whether to show nag messages.

Previously, taskwarrior would apply modifications before deciding
whether to show nag messages, which could lead to spurious nag messages
when completing an active task.
2021-07-30 18:56:25 -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
sebu06
3d61966831 Added coloring of dates with scheduled tasks
Color can be changed using color.calendar.scheduled
2021-07-20 07:38:14 -04:00
sebu06
90bc7f4b23 Fixed rendering of countdown columns
Countdown columns were counting up days instead of down.
2021-07-19 20:07:30 -04:00
sebu06
69b34dcef3 using convenience function for paying attention to verbosity tokens 2021-07-18 15:09:52 -04:00
Sebastian Uharek
bd2ad97ccb Added output of number of tasks to be modified in batch mode 2021-07-18 15:09:52 -04:00
Scott Mcdermott
ac3572a4f5 CLI2: New filter attribute modifier "by", uses '<=' for comparison
This patch allows e.g. due.by:tomorrow that includes all of tomorrow,
because it uses less than or equal to, rather than just less than, like
'before' modifier does.  This allows matching the last second of the day
when filtering by "due.by:eod", and more generally allows date filters
with an inclusive end-interval specification.

Closes #2536
2021-07-18 09:45:00 -04:00
Vladyslav Tronko
af6f2b55ec Fix matching project name during urgency calculation 2021-07-17 16:21:59 -04:00
Tomas Babej
9c2affa0cb libshared: Bump to fix build on OS-X
See [0] and [1] for reference.

[0]: https://github.com/GothenburgBitFactory/libshared/pull/43
[1]: https://github.com/GothenburgBitFactory/libshared/pull/44
2021-07-12 23:02:01 -04:00
Tomas Babej
171a586a3f
libshared: Bump version to enforce safer file writes
Part of a solution for #152.
2021-07-11 20:28:21 -04:00
Tomas Babej
9d80570073 libshared: Bump version
This brings back behaviour of "end of" named dates to point to the last
second of the given date.

Closes #2519.
2021-07-03 10:47:38 -04:00
Tomas Babej
cc0ba46873 feedback: Consider start and end attributes when reporting task durations
Instead of relying on the modification times, we can use the values of
the start and end attributes, if available.

This allows us to perform historical changes that result in correct
duration intervals reported by task info.

Closes #2514
2021-06-26 14:38:18 -04:00
Tomas Babej
8f7e41b392 parseJSON: Allow annotations with missing entry values
This relaxes previous stringent requirements on the input values during
import.

Closes #1804.
2021-06-23 00:13:03 -04:00
Tomas Babej
6d81acd355 parseJSON: Ensure NULL values from failed lookups do not persist
The operator[] insets values if the lookup fails, which creates null
pointers.

See: https://en.cppreference.com/w/cpp/container/map/operator_at
2021-06-23 00:13:03 -04:00
Tomas Babej
a219bd30cf Task: Bump annotations with duplicate entry values
Since annotations are stored as a map, duplicate entry values lead to
data loss (i.e. annotations overriding each other on import). Perhaps
the choice of using a map internally should be reconsidered.

Closes #1938.
2021-06-19 12:29:41 -04:00
Tomas Babej
8b86f16f25 Variant: Do not use implicit fall-through
The code handling the comparison between the date and string types would
convert the variants to correct types, but only through multi-level
fall-through in the switch statement, which is always a bit of a
dangerous construct.

Added explicit return for the non-trivial case, preventing the need for
the fall-through.

Closes #2502.
2021-06-12 15:49:06 -04:00