Commit graph

86 commits

Author SHA1 Message Date
04d21c61fa
test: Add simple happypath annotation adding
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
2025-11-29 21:11:32 +01:00
28c551e157
ref: Print optional error message on editor process error
Editor function takes an optional io object which is used to print an
error output if the subprocess errors.
2025-11-29 21:11:31 +01:00
762b4a288f
fix: Correct whitespace separation on editor shell call
Switch to using 'sequence'-delineated arguments given to the subprocess
run call to correctly handle whitespace.
Also check the output, so we exit if we have an error.
Test accordingly.
2025-11-29 21:11:31 +01:00
3f10b429a2
ref: Rename path expansion function
From `_real_path` to `_expand_path` to better express its use.
2025-11-29 21:11:30 +01:00
49bd1292fa
ref: Extract note parent dir creation function 2025-11-29 21:11:30 +01:00
1ea149c1de
fix: Ensure quiet is a flag on the cli
We regressed quiet into requiring a value to be set as a cli option
(`--quiet=true`) instead of just functioning as a flag (`--quiet`). This
change restores the previous interface on the command line,
and adds a test to ensure no regressions.
2025-11-29 21:10:12 +01:00
e50fc9444a
test: Restructure test files
Extract the individual parsing tests (cli, env, rc) and add additional
configuration test file (TConf and config builder).

To extract the fixtures they have to go into an additional 'conftest.py'
file for pytest to recognize and automatically import them, see:
https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files

and:
https://docs.pytest.org/en/stable/how-to/fixtures.html#using-fixtures-from-other-projects
2025-11-29 21:10:09 +01:00
ff0e6cccfb
fix: Correctly parse boolean config options set to false
Previously, when parsing config options that were set to 'false',
e.g. `TOPEN_NOTES_QUIET=false` in the env vars,
we would still be setting it to true.

This change fixes any falsy value to be correctly parsed as False.
2025-11-29 12:29:34 +01:00
6517eb3971
ref: Reformat build_config function
Make the internal function logic a litte clearer
2025-11-29 12:29:34 +01:00
9b2dc37279
fix: Do not print annotation added if it already exists
Some checks are pending
website / build (push) Waiting to run
website / deploy (push) Blocked by required conditions
Turned annotation adding into a separate (pure) checking function to see
if we have to add an annotation, and a (side-effect) function which
actually adds it.

This way we can decouple checking and send an info to io only if it is
necessary while keeping the two tasks of checking and adding separate.
2025-11-28 23:08:19 +01:00
46135f9325
test: Correctly fall back to EDITOR or VISUAL env vars 2025-11-28 23:08:18 +01:00
620a7bc401
test: Add TConf class tests 2025-11-28 23:08:18 +01:00
cb5e38b503
test: Add rc config file test 2025-11-28 23:08:17 +01:00
97478d62d1
test: Add tests for environment option setting 2025-11-28 23:08:17 +01:00
ee8fef930a
test: Fix correct cli option value casting
Since we can set the type of the relevant option in the OPTIONS dict, we
should also let the cli correctly cast them on parsing, just as the env
options do.
2025-11-28 23:08:16 +01:00
bd05dadf56
test: Add simple pytest harness 2025-11-28 23:08:16 +01:00
db11128beb
ref: Extract sys module use from main func
Main function instead returns the given error code and only when invoked
as a cli script will we use the error code to exit with the
corresponding code to the shell.
2025-11-28 23:08:15 +01:00
ce8ffa3ae8
ref: Extract stdio operations into adapter 2025-11-28 23:08:14 +01:00
d103a632d0
ref: Use OPTION dict defaults for TConf 2025-11-28 23:08:14 +01:00
f8f0a2077d
ref: Extract determining default taskrc from TConf class
To start streamlining the TConf class a little, by removing some
internal logic which may be better residing in the Options dict,
we extract determining the correct taskrc file.
2025-11-28 23:08:13 +01:00
0d2e68a03d
ref: Extract configuration assembly into separate function
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
2025-11-26 23:18:48 +01:00
c164be29d3
ref: Rename taskrc parsing function to parse_rc 2025-11-26 23:18:47 +01:00
b20d56a007
ref: Load all options from single dictionary source 2025-11-26 23:18:47 +01:00
fccfb85026
ref: Rename configparser to cfg 2025-11-26 23:18:46 +01:00
a088fcbe76
feat: Inform user if no file was written
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
When the user exits the note-writing editor process without having
written any file, we also don't attach an annotation to the
corresponding task since it would lead nowhere.

This small change makes this condition obvious to the user, by informing
them that the program is 'doing nothing' when they exit the editor
without having saved a file.
2025-11-11 20:15:41 +01:00
5724c8888d
doc: Improve introduction reading flow
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
2025-09-15 10:56:29 +02:00
09d996eb15
doc: Change suggestion for trying script to versioned release
To try the script we should suggest the stable versioned release not the
main trunk.
2025-09-15 10:56:29 +02:00
1652e01885
doc: Add better cli option metavar annotations 2025-09-15 10:56:28 +02:00
5e6ab6854f
ref: Use recommended subprocess method to edit 2025-09-15 10:56:28 +02:00
7dbd93796d
ref: Remove property setters from dataclass
Some checks failed
website / deploy (push) Has been cancelled
website / build (push) Has been cancelled
Removed the property setters and getters from variables with complex
defaults. Instead, they are now given a specific const default value
`Path("%%%%I_DONT_EXIST_%%%%")` which is very unlikely to be used by a user
in normal circumstances.

This is necessary to be able to remove the properties since Python does
not distinguish between an empty Path() and a non-given Path() (i.e.
there is no Path value which returns Falsy).

However, this slightly clunky construct does allow setting the various
Paths once and only once, and also to remove all the previously
necessary getters and setters with their hidden backing variables.

Lastly it should open the gates for changing the _real_path
transformation to be part of the TConf class itself and not a global
function.
2025-04-22 22:09:58 +02:00
b0a71e804d
fix: Ensure uv lock file points to correct version 2025-04-22 22:09:58 +02:00
4ecf3627d3
ref: Require github release to publish to pypi
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
2025-04-10 09:33:19 +02:00
f546076259
chore: Only publish to test pypi on tagged releases
Some checks are pending
website / build (push) Waiting to run
website / deploy (push) Blocked by required conditions
2025-04-09 12:57:51 +02:00
2b37f24790
feat: Automatically publish full github releases 2025-04-09 12:53:54 +02:00
7673770dbd
fix: Attach distribution files to github release 2025-04-09 12:53:53 +02:00
fb88316bc4
feat: Bump version 2025-04-09 12:12:18 +02:00
f20dd14c6f
chore: Rename release workflow 2025-04-09 12:00:14 +02:00
f9e4b05432
chore: Only run release on main branch and version tag pushes 2025-04-09 11:46:05 +02:00
a263e3ddb0
fix: Require build job before releasing 2025-04-09 11:46:04 +02:00
6eb48bd180
chore: Ignore duplicate markdown headings on different levels
Some checks failed
website / build (push) Waiting to run
website / deploy (push) Blocked by required conditions
Publish python package to pypi and testpypi / Build distribution (push) Has been cancelled
Publish python package to pypi and testpypi / Test publishing to testpypi (push) Has been cancelled
Publish python package to pypi and testpypi / Publish dist to pypi (push) Has been cancelled
Publish python package to pypi and testpypi / Create github release (push) Has been cancelled
Necessary for CHANGELOG to pass since every change contains something
like 'Added', 'Fixed', 'Changed' as headings.

Will still error if there are e.g. multiple 'Added' headings for a
single version.
2025-04-09 11:37:53 +02:00
11d35429c7
doc: Add initial version to CHANGELOG 2025-04-09 11:37:52 +02:00
bfec4f77f3
feat: Add github release automation 2025-04-09 11:37:52 +02:00
771993f999
feat: Add pypi auto publishing
Some checks are pending
website / build (push) Waiting to run
website / deploy (push) Blocked by required conditions
Publish python package to pypi and testpypi / Build distribution (push) Waiting to run
Publish python package to pypi and testpypi / Publish dist to pypi (push) Blocked by required conditions
Publish python package to pypi and testpypi / Test publishing to testpypi (push) Blocked by required conditions
2025-04-09 10:52:14 +02:00
2fb0608a87
doc: Add README badges 2025-04-09 10:47:25 +02:00
2f29054429
doc: Remove leftover footnote 2025-04-09 10:47:24 +02:00
5e7d997e69
doc: Start CHANGELOG
Some checks are pending
website / build (push) Waiting to run
website / deploy (push) Blocked by required conditions
2025-04-08 21:00:28 +02:00
e3db83df46
doc: Update README 2025-04-08 21:00:28 +02:00
ee4f3781f8
feat: Use xdg location or home dir taskrc if it exists
The preference structure goes highest to lowest:

1. ~/.taskrc
2. $XDG_CONFIG_HOME/task/taskrc
3. ~/.config/task/taskrc

Uses first file found.
2025-04-08 21:00:27 +02:00
5976651a26
feat: Create note parent directories if necessary 2025-04-08 21:00:26 +02:00
4642b24c6b
ref: Parse conf file with dict comprehension and named tuple 2025-04-08 21:00:26 +02:00