Comments (13)
Just to clarify: Is the correct behavior that this should not be an error?
from snakecharm.
@olegs Is it really introduce an error?
I've tried
rule all:
output:
foo=touch('foo'),
and
rule all:
output:
foo=touch('foo'),
params:
threads=1
both works ok using snakemake 5.4.0
from snakecharm.
Ok, so I think what @olegs may be trying to say is that the trailing commas are marked red in Pycharm, but trailing commas are actually fine for the snakemake interpreter. In any case, I certainly see this, and I find it a minor annoyance.
from snakecharm.
To clarify, given the following rule definition:
rule my_rule:
input: 'my_input.file',
output: 'my_output.file'
shell: 'echo hi world'
In the above example, output:
is underlined in red. The tooltip reads "Unresolved reference 'output'"
from snakecharm.
@winni2k Thank you for the test case, indeed SnakeCharm plugin highlights the trailing commas as red when they are on the same line as a section name, see the screenshot: error on 4-th line, not on 3-rd
from snakecharm.
Fixed, will be available in next release 0.4.x
from snakecharm.
SnakeCharm doesn't warn of trailing comma
for code which fails on runtime
# $ source activate snakemake
# $ snakemake --use-conda --cores 8
configfile: "config.yaml"
workdir: config['work_dir']
include: "step1_raw_qc.smk"
include: "step2_alignment.smk"
include: "step3_reads_coverage.smk"
rule all:
input:
rules.step1_raw_qc_results.input,
rules.step2_alignment_results.input,
# rules.step3_reads_coverage_results.input
from snakecharm.
But snakemake doesn't fail if I add empty line at the end of file
from snakecharm.
I don't think this is relevant to the comma question as both of these inputs fail with a syntax error on my machine:
rule all:
input:
'bla'
# bla2
rule all:
input:
'bla',
# bla2
Perhaps this is a bug in the snakemake interpreter? It appears the comment is necessary in order for this to be called a syntax error.
from snakecharm.
This also fails:
rule all:
input:
'bla'
# bla2
I think it must be something to do with a file ending in a commented line?
from snakecharm.
@winni2k Yes, looks like some bug in snakemake
from snakecharm.
from snakecharm.
Thanks for fixing this!
from snakecharm.
Related Issues (20)
- Do not show error for conda env that looks like already existing env
- [7.10.0] - Support conda environment definitions to be passed as function pointers, similar to input, params, and resources
- [7.9.0] Basic syntax for `exclude` syntax in use rules
- [7.9.0] Remove excluded names from completion list & resolve
- [ 7.0.0] `template_engine:` basic support
- [7.0.0] `template_engine` future improvements:
- JetBrains Research Get Not compatible with the version of your running IDE (PyCharm 2022.2) HOT 1
- Warn if snakemake section isn't supported in current snakemake project based on snakemake version
- Current version of SnakeCharm is incompatible with PyCharm 2022.3 HOT 1
- java.lang.RuntimeException: child must not be null: expression text [methylome]
- Make Snakecharm trusted plugins, even though it is provided not by JetBrains but by JetBrains Research.
- JetBrains Gateway support HOT 2
- Current version of SnakeCharm is incompatible with PyCharm 2023.1 HOT 2
- Exception: "Access is allowed from write thread only" creating project in dumb mode HOT 2
- PyCharm 2023.3 Support
- Show notice on deprecated features HOT 1
- Unresolved reference warning when iterating over 'input' key-value pairs using '.items()'
- [7.11] Resources scopes support
- Unresolved reference 'snakemake' HOT 3
- Wildcard not defined in output of Target Rule HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snakecharm.