Commit graph

6135 commits

Author SHA1 Message Date
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
Tomas Babej
c98fe5f34b
cmake: Remove recur2.cpp from CMakeLists 2021-06-12 10:40:47 -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
5e5a48606f CmdExec: Prevent user from executing an empty command
Closes #2503.
2021-06-10 21:44:07 -04:00
oxalica
2cb8f1d5ea Support relative include for themes in taskrc 2021-06-02 19:34:57 -04:00
oxalica
3672ed0c1b Remove build date/time from diagnostic message
This message does not really help, and makes the binary
non-deterministic.
2021-06-02 19:33:39 -04:00
begasus
4fff27f4bc Fix reference for errno.h on Haiku 2021-05-14 00:04:48 -04:00
Rosen Penev
73575f8d88 convert manual loops to std::count_if
Simpler and generates less assembly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-01 21:20:52 -04:00
Tomas Babej
62399239ca Filter: Make +ACTIVE trigger pendingOnly shortcut 2021-04-24 15:28:00 -04:00
Tomas Babej
523e2b40fe Filter: Consider presence of +PENDING tag signal to skip completed.data
This puts +PENDING at the same level of treatment as status:pending when
it comes to decision whether the data processed should be pending only.

The mechanism is by no means perfect and should be improved in the
future.
2021-04-24 15:28:00 -04:00
Tomas Babej
5e87be4641 Filter: Fix copy-paste error in pendingOnly 2021-04-24 15:28:00 -04:00
Tomas Babej
c7fd6b798b libshared: Bump version to support Pig.getUntilAscii 2021-04-24 10:47:28 -04:00
Tomas Babej
87d0499fc8 performance: Use ascii-only version of getUnitl for parsing attribute names
Not having to consider utf-8 characters has performance benefits.
2021-04-24 10:47:28 -04:00
Tomas Babej
95b135b59e DOM: Create a copy of Task object only if needed 2021-04-24 10:47:28 -04:00
Tomas Babej
87b0be9b6f performance: Pre-emptively reserve size of the values vector
Each token will add a corresponding Variant into the vector, so we can
avoid the performance penalty connected with dynamic resizes of the
vector.
2021-04-24 10:47:28 -04:00
Tomas Babej
312f77f703 performance: Do not use Pig to extract raw line content 2021-04-24 10:47:28 -04:00
Tomas Babej
e7487c8a63 performance: Avoid lexing input when not needed in getDOM
Lexing a token can be expensive operation. Perform lexing only if a
UUID/ID reference could have been provided.
2021-04-24 10:47:28 -04:00
Tomas Babej
c3f9d09d22 performance: Cache used command value
The detected command does not change once CLI2::analysis has been
performed. Cache the value of the command to avoid the need to
re-discover the correct value each time we're interested in it.
2021-04-24 10:47:28 -04:00
Tomas Babej
a19773873a performance: Cache CLI2::canonicalize lookups
Canonicalization of attributes or attribute prefixes happens once per
every single task considered in the filtering process. It maps short,
prefixed names to their full-length versions, for example:

"pro" -> "project" in the expression "project:Home"

It follows that such process is not task-dependant and as such the
lookups can be cached.
2021-04-24 10:47:28 -04:00
Rosen Penev
ab7f5b0b51 clang-tidy: loop conversion
Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 09:13:22 -04:00
Rosen Penev
15f0ab87e0 clang-tidy: use const references
Found with performance-for-range-copy

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 01:59:45 -04:00
Rosen Penev
e84930be8d clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 01:39:23 -04:00
Rosen Penev
d0c4350c2f clang-tidy: add missing reserve calls
Found with performance-inefficient-vector-operation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 00:22:43 -04:00
Rosen Penev
3cafb5257e clang-tidy: use = default
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 00:15:06 -04:00
Rosen Penev
4aaaa8dcc8 clang-tidy: use bool literals
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-23 00:11:52 -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
44220287c4 CmdCalendar: Only display relevant parts of the legend 2021-04-21 23:44:36 -04:00
Tomas Babej
282f3d344a
CmdCalendar: Adjust styling 2021-04-21 23:09:08 -04:00