Skip to content

Make type checker aware of snakemake global in script files #32

Open
@jlumpe

Description

@jlumpe

Don't know how easy this is to do with an extension, but an annoyance of writing workflows in VS Code is the implicitly defined snakemake global variable. The type checker is not aware of this and will generate an "undefined variable" warning for each usage.

I'm using the following workaround for this:

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from snakemake.script import Snakemake
    snakemake: Snakemake
    snakemake = None  # type: ignore

But it would be really great if this could be automatically applied somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions