fix: Allow hyphens in config keys given on the command line.#2998
fix: Allow hyphens in config keys given on the command line.#2998johanneskoester merged 2 commits intosnakemake:mainfrom
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe recent changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant ConfigParser
User->>CLI: Submit configuration
CLI->>ConfigParser: Parse configuration
ConfigParser-->>CLI: Validate keys with regex
CLI-->>User: Return success/failure
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
🤖 I have created a release *beep* *boop* --- ## [8.17.0](v8.16.0...v8.17.0) (2024-08-13) ### Features * fix job rate limiting with --max-jobs-per-second and introduce the more flexible --max-jobs-per-timespan ([#3010](#3010)) ([9c31257](9c31257)) ### Bug Fixes * Allow hyphens in config keys given on the command line. ([#2998](#2998)) ([b70c0db](b70c0db)) * allowing trailing '+' in name patterns ([#3002](#3002)) ([59150d3](59150d3)) * print message if not yet enough resources for executing further jobs ([b8df036](b8df036)) * unawaited coroutine sanitize_local_storage_copies ([#2972](#2972)) ([715c572](715c572)) ### Documentation * Change sha256 checksum in docs to more realistic example ([#2987](#2987)) ([16a5cf2](16a5cf2)) * Make it more clear that the cluster commands now require a plugin ([#2976](#2976)) ([74134cf](74134cf)) * Update installation.rst to recommend Miniforge instead of Mambaforge ([#2975](#2975)) ([0fc7619](0fc7619)) * use plain monospace font instead of theme default that changes >= into ≥ ([cc17fc1](cc17fc1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



It is possible to use hyphens when specifying config keys given in the configfile, but when given on the command line as
--config key-with-hyphens=value, it fails. With this PR, hyphens are allowed in the middle of config keys, when given on the command line.As far as I understand, hyphens are valid for keys in the yaml specification: https://yaml.org/spec/1.2.2/ https://www.yaml.info/learn/bestpractices.html
I have been using this code in my projects for a while and I don't think it introduces any problems, especially since hyphens have been allowed in the config file for a very long time.
The motivation for me to use hyphens in the command line config is discussed here: #2986
Best, Carl
QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit