You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,9 @@ snakefmt - < Snakefile
235
235
236
236
### Full Usage
237
237
238
+
<details>
239
+
<summary>Show full help output</summary>
240
+
238
241
```
239
242
$ snakefmt --help
240
243
Usage: snakefmt [OPTIONS] [SRC]...
@@ -289,10 +292,15 @@ Options:
289
292
-v, --verbose Turns on debug-level logger.
290
293
```
291
294
295
+
</details>
296
+
292
297
### Directive Sorting
293
298
294
299
By default, `snakefmt` sorts rule and module directives (like `input`, `output`, `shell`, etc.) into a consistent order. This makes rules easier to read and allows for quicker cross-referencing between inputs, outputs, and the resources used by the execution command.
295
300
301
+
<details>
302
+
<summary>Directive ordering details</summary>
303
+
296
304
Directives are grouped by their functional role in the following order:
297
305
298
306
1. **Identity & Early Control**: `name`, `default_target`
@@ -306,6 +314,8 @@ Directives are grouped by their functional role in the following order:
306
314
307
315
This ordering ensures that the directives most frequently used in execution blocks (like `threads`, `resources`, and`params`) are placed immediately above the action directive.
308
316
317
+
</details>
318
+
309
319
You can disable this feature using the `--no-sort` flag.
310
320
311
321
### Shell Block Formatting
@@ -369,6 +379,9 @@ format_shell = false
369
379
370
380
`shfmt`is invoked with`-i 4-ci -bn` (four-space indentation, indented switch cases, binary operators may start a line).
Disables directive sorting for the enclosed region while still applying all other formatting.
@@ -503,6 +521,8 @@ rule also_formatted:
503
521
>**Note:**`# fmt: skip` is not yet supported within Snakemake rule blocks.
504
522
> It currently applies only to plain Python lines outside of rules, checkpoints, and similar Snakemake constructs.
505
523
524
+
</details>
525
+
506
526
### Configuration
507
527
508
528
`snakefmt`is able to read project-specific default values for its command line options
@@ -566,7 +586,11 @@ Then [install pre-commit](https://pre-commit.com/#installation) and initialize t
566
586
567
587
[GitHub Actions](https://github.com/features/actions) in combination with [super-linter](https://github.com/github/super-linter) allows you to automatically run `snakefmt` on all Snakefiles in your repository e.g. whenever you push a new commit.
568
588
569
-
To do so, create the file`.github/workflows/linter.yml`in your repository:
0 commit comments