Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add detection of Snakefile #112

Open
HDembinski opened this issue Mar 25, 2020 · 2 comments
Open

Add detection of Snakefile #112

HDembinski opened this issue Mar 25, 2020 · 2 comments

Comments

@HDembinski
Copy link

Copied from atom/atom#20382

Description

https://snakemake.readthedocs.io/en/stable/ is a popular tool in data science. It parses so-called "Snakefile"s which are similar to "Makefile"s.

The grammar selector detects a "Snakefile" as source.python, but it should be source.yaml. This causes issues with linters and autoformatters like python-black, which should not be run for Snakefiles.

Steps to Reproduce

  1. Generate a file called "Snakefile" with the following content:
import glob

rule all:
    input: ["data/foo.root", "data/bar.root"]

rule make_foo:
    input: "{name}.root"
    output: "{name}_pv.root"
    shell: "./make_foo.py {input} {output}"
  1. Open file in Atom, it is detected as python.source.

Expected behavior:

The grammar selector should detect a "Snakefile" as source.yaml.

Actual behavior:

The grammar selector detects a "Snakefile" as source.python.

Reproduces how often:

Always.

Versions

Atom : 1.43.0
Electron: 4.2.7
Chrome : 69.0.3497.128
Node : 10.11.0

@Nixinova
Copy link

Nixinova commented Mar 12, 2021

Are Snakefiles not meant to be Python? Search shows that all of them contain python code, and your example includes an import statement.

@HDembinski
Copy link
Author

HDembinski commented Mar 22, 2021

They are neither yaml nor Python. Look closely at the code example, this is not valid Python syntax.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants