fix: allowing trailing '+' in name patterns#3002
Conversation
|
Please format your code with black: |
|
brrrr, I consider this failure unrelated to the PR: But, of course, the rest will not run. |
|
Seems like the floats are not correctly converted into plain string representations. A fix would be greatly appreciated, I don't have any time in the next days. |
|
Already thought, that a fix might be trivial, but whether I will find the time ... Let's see. edit: Or perhaps not so trivial - doubt that the actual code needs adaption, because np.float is quit ok and panda-ish. I'll give changing the expected results a try ... |
|
Definitively not trivial. We could:
All three options sound like tinkering to me. |
WalkthroughThe recent changes enhance the validation logic for naming patterns in the Snakemake linter. By modifying the regular expression for Changes
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 (
|
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- snakemake/linting/init.py (1 hunks)
Additional comments not posted (1)
snakemake/linting/__init__.py (1)
8-13: Regex modification looks good. Verify its impact on the codebase.The addition of the negative lookahead
(?!\\+)in theNAME_PATTERNregex is well-implemented and aligns with the PR's objective to prevent trailing '+' characters. The comment provides a clear explanation of the change and potential risks.To ensure the change does not introduce unintended side effects, verify that all relevant tests pass and that the regex behaves as expected in all scenarios.
|
Thank you, @johanneskoester — this PR can now possibly be merged. The coderabit summarizes my intent perfectly. ;-) What do you think? |
|
Thank you! |
|
Thank you for the swift review! |
🤖 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>
|
I'm a bit confused here, as a long-running snakefile now produces a new warning: This is to limit the wildcard matching to only digits. Should I ignore the warning? Should I update the rules? Should I provide more detail? Thanks! |
|
Thanks for reporting this!!! You may ignore the warning. I will not. Can you please indicate the entire rule? Is there, perhaps, more detail to the warning message? Actually, this PR only affected the linter, not the Snakemake core. So, this might be totally unrelated. But we should sort this out, before perhaps opening a full issue. |
It's quite reproducible on my side: FILE: snaketestCONSOLE... ... The execution judging by the shell command is not affected. Same file and command with Snakemake 8.16.0 does not show this warning. Snakemake is a very helpful package for me. Thanks a lot ! |
|
Ah, yes, this alone is a faulty syntax expression. Try output:
r"test{num,\d+}.txt" |
That indeed fixed the warning. Thanks. |
|
ah, thanks. It's a Python thing. Will fix the docs. |




This PR should fix issue #3001:
A workflow might contain simple regexes within Python code, e.g.
r"\s+". Prior to this PR theNAME_PATTERNof the linter considered this first part, thesas part of a string to be concatenated with a path.QC
There is no additional test (yet. Not sure it needs one). Docs do not need updating as the intended behaviour does not change.
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
New Features
Documentation