Git Product home page Git Product logo

Comments (13)

winni2k avatar winni2k commented on May 29, 2024

Just to clarify: Is the correct behavior that this should not be an error?

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

@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.

winni2k avatar winni2k commented on May 29, 2024

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.

winni2k avatar winni2k commented on May 29, 2024

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.

iromeo avatar iromeo commented on May 29, 2024

@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
image

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

Fixed, will be available in next release 0.4.x

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

SnakeCharm doesn't warn of trailing comma for code which fails on runtime
image

# $ 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.

iromeo avatar iromeo commented on May 29, 2024

But snakemake doesn't fail if I add empty line at the end of file
image

from snakecharm.

winni2k avatar winni2k commented on May 29, 2024

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.

winni2k avatar winni2k commented on May 29, 2024

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.

iromeo avatar iromeo commented on May 29, 2024

@winni2k Yes, looks like some bug in snakemake

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

image

from snakecharm.

olegs avatar olegs commented on May 29, 2024

Thanks for fixing this!

from snakecharm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.