aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/samplecode/snakefmt/out.smk
blob: 049f04c0e2dcf6dd2777d40496189d0e82c90c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from snakemake.utils import min_version

min_version("5.14.0")


configfile: "config.yaml"  # snakemake keywords are treated like classes i.e. 2 newlines


SAMPLES = ["s1", "s2"]  # strings are normalised
CONDITIONS = [
    "a",
    "b",
    "longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong",
]  # long lines are wrapped


include: "rules/foo.smk"  # 2 newlines


rule all:
    input:
        "data/results.txt",  # newlines after keywords enforced and trailing comma


rule gets_separated_by_two_newlines:
    input:
        files=expand(
            "long/string/to/data/files/gets_broken_by_black/{sample}.{condition}",
            sample=SAMPLES,
            condition=CONDITIONS,
        ),


if True:

    rule can_be_inside_python_code:
        input:
            "parameters",
            "get_indented",
        threads: 4  # Numeric params stay unindented
        params:
            key_val="PEP8_formatted",
        run:
            print("weirdly_spaced_string_gets_respaced")