Recent commits to derivepassphrase.git (208429075c67c884f55d76474e8c8a4baea616ab) https://git.schokokeks.org/derivepassphrase.git/tree/208429075c67c884f55d76474e8c8a4baea616ab Recent commits feed provided by GitList. Make the mutually exclusive options helper function print the correct parameter name The `click.Parameter.human_readable_name` attribute yields the metavar for arguments, and the function parameter name for options. The documentation calls the latter the "name" for the option, perhaps under the assumption that you would never pass an explicit parameter name to the option decorator. I disagree with this, it is horrible design: sometimes the value is usable as a function parameter (options), sometimes it isn't (arguments), and vice versa for constructing a command-line, so it is neither usable as a command-line parameter display name nor as a function parameter name. So what *is* it even good for...? Include our own logic to select an appropriate display name for our options. This requires querying `click.Parameter` attributes that should be public, but are internal. Why...?! https://git.schokokeks.org/derivepassphrase.git/commit/208429075c67c884f55d76474e8c8a4baea616ab software@the13thletter.info (Marco Ricci) Wed, 25 Dec 2024 18:59:32 +0100 208429075c67c884f55d76474e8c8a4baea616ab Add small fixes to changelog, docstrings and variable names https://git.schokokeks.org/derivepassphrase.git/commit/4bfbfa3c9eb2e4a82707289da46fa3665aa24283 software@the13thletter.info (Marco Ricci) Wed, 25 Dec 2024 17:15:23 +0100 4bfbfa3c9eb2e4a82707289da46fa3665aa24283 Instruct `coverage` to record the test function for each covered line Enable the standard dynamic context setting `test_function` for `coverage`. This is immensely helpful for debugging whether and which tests trigger or don't trigger a certain branch of code in a multi-branch block (`if`/`elif`/`else`, `match`/`case` blocks, dispatch tables, etc.). https://git.schokokeks.org/derivepassphrase.git/commit/bdf02f629dc0dbc1b72d74f56a6edb06d681ab60 software@the13thletter.info (Marco Ricci) Sat, 21 Dec 2024 01:02:34 +0100 bdf02f629dc0dbc1b72d74f56a6edb06d681ab60 Fix formatting, some coverage pragmas and some linting rules in tests Aside from formatting fixes, disable the E501/line-too-long and C419/unnecessary-comprehension-in-call linting rules in tests, where they hinder debuggability of the tests. (See embedded comments for full rationale.) Furthermore, make `coverage` recognize `@overload` lines automatically as lines that should not be included in coverage, like `assert False` and friends. https://git.schokokeks.org/derivepassphrase.git/commit/f36630533e3f8d9932e4b1b2975ec3d8bde7b45a software@the13thletter.info (Marco Ricci) Sat, 21 Dec 2024 00:57:49 +0100 f36630533e3f8d9932e4b1b2975ec3d8bde7b45a Support exporting the `vault` configuration as a POSIX shell script When exporting `vault` configurations via `--export`, a new option `--export-as=FORMAT` allows selecting the export format (defaulting to `json`). Setting `FORMAT` as `sh` selects the new POSIX shell script export format, which yields a sh(1)-compatible script to reimport the existing configuration as a series of calls to the `derivepassphrase` command. Because the output is very regular, the test suite also includes an interpreter specifically for the sh(1) subset emitted during an `sh` export, on top of the usual adaptations to existing tests for the new functionality. https://git.schokokeks.org/derivepassphrase.git/commit/cefe3175dd103226d6d404886a091f6dfe85026f software@the13thletter.info (Marco Ricci) Sat, 21 Dec 2024 00:23:33 +0100 cefe3175dd103226d6d404886a091f6dfe85026f Allow unsetting settings when configuring `vault` When configuring a `vault` service, or the global settings, a new configuration option `--unset FIELD` will unset the specified `FIELD` from the service or global settings prior to and addition to applying the requested settings changes. This way, the user can update all settings on the command-line (except for the "notes") without manually editing and reimporting a configuration export. (It is permissible to only unset settings, without applying any other configuration changes.) https://git.schokokeks.org/derivepassphrase.git/commit/7a43a0cf4ea5877b3ff07576d5ee5c3ad36c087b software@the13thletter.info (Marco Ricci) Fri, 20 Dec 2024 17:00:48 +0100 7a43a0cf4ea5877b3ff07576d5ee5c3ad36c087b Rework `ConfigManagementStateMachine` rules for higher data generation success rates Lower the failure/retry rate for data generation by moving all data generation into initialization rules and by removing data restrictions on rule inputs as far as possible, turning the rule effectively into a no-op if necessary. The only currently remaining operation with notable retry rate is the top-level rule selection. https://git.schokokeks.org/derivepassphrase.git/commit/8e7790551f023105c34a02df27bf6358e6d06d52 software@the13thletter.info (Marco Ricci) Fri, 20 Dec 2024 15:06:20 +0100 8e7790551f023105c34a02df27bf6358e6d06d52 Fix empty key handling in `vault` config, and harmonize warning text Correctly handle empty `key` settings in the `vault` configuration: if at the global level, it is equivalent to eliding the setting, but at the service level, it explicitly disables key usage (even if a global key is set). This implies that both cases need different cleanup steps. Harmonize the warning message for ineffective passphrases for services: always include the affected service name. If during configuration import we find a key shadowing a passphrase, issue the same ineffective passphrase warning as would happen during interactive configuration or interactive use. (The tests need minor modifications and reparametrization to continue to cover all warning cases.) https://git.schokokeks.org/derivepassphrase.git/commit/c9e143e6c04d7b667caa34efa02a210d78e3086a software@the13thletter.info (Marco Ricci) Fri, 20 Dec 2024 11:39:45 +0100 c9e143e6c04d7b667caa34efa02a210d78e3086a Rewrite incompatible option checking for more readability https://git.schokokeks.org/derivepassphrase.git/commit/712a1d0d2abca699aae9bf6473dd336a2f3bd55e software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:47:42 +0100 712a1d0d2abca699aae9bf6473dd336a2f3bd55e Document handling of file objects internally in CLI The type hints for `click.open_file` are so broad that our file objects, intended to be typed as `typing.TextIO`, end up getting typed as `typing.TextIO | typing.IO[typing.Any]` instead. Fix this by casting, explicitly, one level higher. Also document why no further checks for readability or writablility are actually performed. https://git.schokokeks.org/derivepassphrase.git/commit/bc746734305a81187ecbdf856cbaebf34f22c470 software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:27:08 +0100 bc746734305a81187ecbdf856cbaebf34f22c470