-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in 0.8.0: some comments cause "InvalidPython: Black error:" #169
Comments
This is valid snakemake. It will be an issue in snakefmt - comments are surprisingly difficult to deal with. |
fwiw, here is another example that triggers that error:
|
Ooh, that latter bug is nastier @ptrebert as it's much more likely to be in common use. Did you find that by running 0.8.0 on a standard code base? |
stuff like that is flagged in several of my snakemake files. I would definitely agree that this is quite common (or should be, because we all diligently comment our code, right 😉 ) |
Any double comment lines will cause the error?
This one also cause error in version 0.8. [DEBUG]
|
Another example of probably the same bug: onstart:
# Saves onstart Slack message thread timestamp to file SLACK_TS_FILE
shell(
f"./bin/notify-on-start {config.get('build_name', 'unknown')} {SLACK_TS_FILE}"
) Workaround with docstring |
Thanks, I'm currently working on this issue, hopefully will have something in the next day or two |
* add failing test for comment in run block snakemake#169 (comment) * fix incorrect test * add and fix two tests * fix test case with two comments in global context * add test with comment after onstart
* add failing test for comment in run block #169 (comment) * fix incorrect test * add and fix two tests * fix test case with two comments in global context * add test with comment after onstart
Testing new release 0.8.0 I noticed a small regression
Does not format with:
Two comments in a row don't work, maybe this isn't valid snakemake? Not sure.
This is not a big bug, as one can simply put a triple quoted string there instead. Also it's good that it simply fails formatting rather than formatting to something that changes semantics.
cc @mbhall88
The text was updated successfully, but these errors were encountered: