Commit graph

622 commits

Author SHA1 Message Date
linsaraj
c2b13a35cc
Merge d17bd52a58 into ffa0d3e944 2025-06-09 22:53:40 +05:30
Dustin J. Mitchell
75d351afad
Do not auto-create .taskrc when stdout is not a TTY (#3888)
* Do not auto-create .taskrc when stdout is not a TTY

This avoids prompting or automatically creating such a file, both of
which are unexpected when performing command-line completion.

Fixes #3751.

* Test case for taskrc creation no longer works

A taskrc is only created when stdout is a tty, which would require
allocating a pty, which is very platform-dependent and definitely not
worth the trouble for this test.
2025-06-02 07:59:05 -04:00
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
a701f8fc7d
Open Replica read-only when possible (#3776)
* Open Replica read-only when possible

Specifically, when either
 - the command is read-only; or
 - the command requires GC (including recurrence updates) but GC is disabled by config

* [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-14 10:25:19 +01:00
linsaraj
911f1c6348
Update src/Context.cpp
Co-authored-by: Dustin J. Mitchell <dustin@v.igoro.us>
2025-02-07 17:49:43 -06:00
linsaraj
d8eb58eb04 Relocated all "color." related settings to a newly created file called "default.theme" and included that file in "Context.cpp" 2025-02-06 23:10:47 -05:00
Dustin J. Mitchell
7871617e9c
Only handleRecurrence/handleUntil when rc.gc=1 (#3772) 2025-02-06 08:30:41 +01: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
758ac8f850
Add support for sync to AWS (#3723)
This is closely modeled on support for sync to GCP (#3223), but with
different authentication options to mirror typical usage of AWS.
2024-12-17 01:08:50 +00:00
Dustin J. Mitchell
54a94bd18c
include bubblegum-256.theme in default .taskrc (#3673) 2024-11-08 13:10:04 +01:00
Dustin J. Mitchell
a2f9b92d6c
Better undo output (and remove undo.style config) (#3672) 2024-11-07 14:56:34 -05:00
Scott Mcdermott
3e20ad6f6f
Pass rc.weekstart to libshared for ISO8601 weeknum parsing if "monday" (#3654)
* libshared: bump for weekstart, epoch defines, eopww fix

mainly those visible changes, and miscellaneous others

see GothenburgBitFactory/taskwarrior#3623 (weekstart)
see GothenburgBitFactory/taskwarrior#3651 (epoch limit defines)
see GothenburgBitFactory/libshared#73 (eopww fix)

* Initialize libshared's weekstart from user's rc.weekstart config

This enables use of newer libshared code that can parse week numbers
according to ISO8601 instead of existing code which is always using
Sunday-based weeks.  To get ISO behavior, set rc.weekstart=monday.
Default is still Sunday / old algorithm, as before, since Sunday is in
the hardcoded default rcfile.

Weekstart does not yet fix week-relative shortcuts, which will still
always use Monday.

See #3623 for further details.
2024-10-19 16:00:50 -04:00
Dustin J. Mitchell
4ff63a7960
Use TaskChampion 0.7.0, now via cxx instead of hand-rolled FFI (#3588)
TC 0.7.0 introduces a new `TaskData` type that maps to Taskwarrior's
`Task` type more cleanly. It also introduces the idea of gathering lists
of operations and "committing" them to a replica.

A consequence of this change is that TaskChampion no longer
automatically maintains dependency information, so Taskwarrior must do
so, with its `TDB2::dependency_sync` method. This method does a very
similar thing to what TaskChampion had been doing, so this is a shift of
responsibility but not a major performance difference.

Cxx is .. not great. It is missing a lot of useful things that make a
general-purpose bridge impractical:

 - no support for trait objects
 - no support for `Option<T>` (https://github.com/dtolnay/cxx/issues/87)
 - no support for `Vec<Box<..>>`

As a result, some creativity is required in writing the bridge, for
example returning a `Vec<OptionTaskData>` from `all_task_data` to allow
individual `TaskData` values to be "taken" from the vector.

That said, Cxx is the current state-of-the-art, and does a good job of
ensuring memory safety, at the cost of some slightly awkward APIs.

Subsequent work can remove the "TDB2" layer and allow commands and other
parts of Taskwarrior to interface directly with the `Replica`.
2024-08-11 02:06:00 +00: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
Adrian Sadłocha
9c49863795
Make task news nag configurable and deterministic (#3567)
This patch fixes #3497.
2024-07-26 20:30:54 -04:00
Dustin J. Mitchell
7d79b9e516
Rename 'expiration.on-sync' to 'purge.on-sync' (#3556)
Taskwarrior uses "expire" to refer to deletion of tasks past their
"until" date, so let's use `purge` to link this semantically to the
`task purge` command.
2024-07-14 15:45:26 -04:00
Dustin J. Mitchell
213b9d3aee
Add support for task expiration (#3546) 2024-07-09 16:39:39 -04:00
Hector Dearman
fa5604ea8d
Relax sync.server.origin to allow paths (#3423) 2024-07-04 23:17:52 +00:00
Sebastian Carlos
b70d8ef574
Remove locking config (#3519)
This flag is no longer needed. It was used to control file locking on the *.data files.

Co-authored-by: Sebastian Carlos <sebastiancarlos@gmail.com>
2024-06-28 18:12:10 -04:00
Sebastian Carlos
64609a0407
Consistently exclude WAITING tasks from reports which filter by status (#3525)
Consistently exclude WAITING tasks from reports which filter by status

If I understand correctly, the virtual status "waiting" is deprecated.
This is why some reports include the explicit "-WAITING" filter even
though it is not necessary: The idea is that being explicit will be
needed in the future when the "waiting" status is removed.

But I noticed that some reports do not include the "-WAITING" filter, so
I added it to all reports that filter by status.
2024-06-28 18:02:37 -04:00
Dustin J. Mitchell
5f983a66af
Include version in default-generated .taskrc (#3500)
This will avoid new users being prompted with all the news since
2.5.0.
2024-06-21 08:32:09 -04:00
Dustin J. Mitchell
28a46880a2
Treat a nonzero exit status as a failure (#3430)
And fix the test cases that have been failing ,undetected
2024-05-03 13:58:09 +00:00
Akash Shanmugaraj
aeb6acf640
added BYOS (Bring Your Own SERVICE_ACCOUNT) for GCS authentication (#3262) 2024-01-27 07:57:12 -05:00
Dustin J. Mitchell
daca37806e
Rename sync.server.encryption_secret to sync.encryption_secret. (#3249)
* Rename `sync.server.encryption_secret` to `sync.encryption_secret`.

* move pwgen
2024-01-21 19:11:24 -05:00
Dustin J. Mitchell
9566c929e2
Add support for cloud sync, specifically GCP (#3223)
* Add support for cloud sync, specifically GCP

This adds generic support for sync to cloud services, with specific
spuport for GCP. Adding others -- so long as they support a
compare-and-set operation -- should be comparatively straightforward.

The cloud support includes cleanup of unnecessary data, and should keep
total space usage roughly proportional to the number of tasks.

Co-authored-by: ryneeverett <ryneeverett@gmail.com>
2024-01-21 12:36:37 -05:00
Dustin J. Mitchell
7f68441916
Change "client key" to "client id" (#3130)
In #3118 @ryneeverett mentioned that "key" suggests that this is a
secret, when in truth it's just a user identifier. So "ID" is a better
word for it than "key".
2023-07-11 22:13:53 -04:00
Dustin J. Mitchell
31105c2ba3
Sync against taskchampion-sync-server (#3118)
This removes use of gnutls and the TLS implementation, which is no
longer needed (task synchronization is handled via Taskchampion, which
uses `reqwest`, which handles TLS via other Rust dependencies). This
incidentally removes the following config options:
 * `debug.tls`
 * `taskd.ca`
 * `taskd.certificate`
 * `taskd.ciphers`
 * `taskd.credentials`
 * `taskd.key`
 * `taskd.server`
 * `taskd.trust`
2023-07-08 10:27:33 -04:00
Dustin J. Mitchell
771977aa69 Restore check for missing config 2023-07-04 14:08:51 -04:00
Dustin J. Mitchell
9df4c8156e remove TDB::commit 2023-06-11 17:37:03 -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
35c8ce2ccb Remove references to TDB2::read_only
A TC replica is always read-write.
2022-07-24 14:18:21 -04:00
Tomas Babej
0a558ef7c8 Context: Add a reminder to mirror options in the vim syntax file 2022-05-07 21:52:22 -04:00
Tomas Babej
1fc1884017 Context: Add parent column among default ones for the recurring report
This helps to identify parent-child relationships.
2022-03-14 02:48:13 -04:00
Tomas Babej
75ce386b44 Context: Adjust definition of the recurring report filter
Ensure the recurring report lists the recurring parent tasks as well as
the child tasks.
2022-03-14 02:48:13 -04:00
Patrick Flakus
59a1729a05 Cleanup: Fixed typo in docstring 2022-01-27 16:10:47 -05:00
Dustin J. Mitchell
b066a17ebe use a reference in CurrentTask 2021-12-30 15:03:37 -05:00
Dustin J. Mitchell
53127bf844 add Context::withCurrentTask 2021-12-30 15:03:37 -05:00
Tomas Babej
3a00956144 ColDepends: Allow specifying short(er) UUIDs 2021-12-03 03:57:37 -05:00
Jakub Wilk
04ef785eea Fix typo 2021-11-06 11:50:02 -04:00
Tomas Babej
d5a026d91a
context: Interpret legacy-style context as read context only
This provides a better migration path than surprising users with the
write context functionality out of the blue.

Closes #2620.
2021-10-14 22:34:48 -04:00
Tomas Babej
1d4baca0d9
context: Do not interpret empty filter/mods as missing context definition
This is a corner case bug, when user has both old-style and new-style
context defined, where new-style is defined as empty string, the
old-style will (incorrectly) take precedence.

Closes #2629.
2021-10-14 17:47:11 -04:00
Tomas Babej
34c12a7b78
Context: Add news.version among configuration defaults
Otherwise news.version shows up as unrecognized variable.
2021-10-02 18:27:57 -04:00
Tomas Babej
36604c95d2 Context: Document the availability of environment variables in the taskrc 2021-09-28 23:38:33 -04:00
Tomas Babej
cd2abc7132 Replace references to monthsperline with calendar.monthsperline 2021-09-25 13:34:58 -04:00
Tomas Babej
04e84cb06f refactoring: Reorder verbosity tokens 2021-09-16 07:15:54 -04:00
Tomas Babej
9a3b103861 Context: Override verbosity token should not imply header
Users might want to only opt-in into footnote override notifications,
without seeing header-based override information about TASKRC or
TASKDATA.
2021-09-16 07:15:54 -04:00
Tomas Babej
ed6249fee6 Context: Make default/override imply header 2021-09-16 07:15:54 -04:00
Tomas Babej
712f0080dd Context: Introduce 'default' verbosity token
The purpose of this token is to control the display of information
messages about taskwarrior choosing a default action of some sort.
2021-09-16 07:15:54 -04:00