GothenburgBitFactory / GothenburgBitFactory/taskwarrior

Checking configuration values in hooks is unnecessarily hard

Open
#3,839 0 comments 0 reactions 0 assignees View on GitHub
topic:hooks
Dominant language
C++
Stars
6.1k
Forks
423
Avg merge
1d 19h
Merged PRs (30d)
11

Description

## Problem

A hook might want to add further debugging output (e.g., `set -x` in a shell based hook), if it detects the `hooks.debug` configuration option being `1` or greater.
Currently, to do that a hook cannot simply use `task _get rc.hooks.debug`, as this would miss command line overrides.
Thus, the hook must also reparse the `task` command line arguments, check for rc overrides and apply these.

The reparsing step is helped by structured metadata input, but even with a correctly split command line this stays harder that it needs to be.

## Proposed improvement
Applying the overrides would make it possible for the hooks to query on rc key and get the “correct” setting (i.e., the overridden value or the default otherwise).
If we use structured metadata input, we could simply supply the task rc DOM as nested JSON attribute set under the toplevel `rc` key.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.