A prettifier for CWL code
Project description
Copyright SBG Description: # CWL Format
![](https://github.com/rabix/cwlformat/workflows/Tests/badge.svg)
CWL Format is a specification and a reference implementation for a very opinionated code formatter for CWL.
It outputs CWL in a standardized YAML format. It has no settings or options because you have better things to do with your time. And because CWL Format is always correct.
This repository lists the formatting rules and also contains a Python implementation of the formatter.
## Rules
Only comment lines at the top of the file, including blank lines, before the actual CWL code are preserved. All other comments are lost. Do not use this if all comments in the YAML are important to you.
All CWL fields are ordered systematically. The field order for specific fields have a defined precedence (“pinned fields”). Any fields not present in this file (“free fields”) are printed after the pinned fields and ordered alphabetically.
The pinned fields are defined in [this YAML file](cwlformat/keyorder.yml).
Specific pinned field orderings are available for CommandLineTool, ExpressionTool and Workflow processes. All other types follow a generic pinned field list.
All strings that fit within 80 columns are expressed in flow style. Longer strings or strings with new lines are expressed in block style.
All lists and maps are expressed in block style
The ordering of all lists are preserved
Indentation is 2 spaces, including for lists
## Conformance tests
A series of documents are found in the [tests](tests/cwl) directory that can be used to check correctness of a formatter. The files named original-* are the input files and the files named formatted-* are the corresponding formatted documents. There are a mixture of YAML and JSON input files. Formatted files are always YAML.
Platform: UNKNOWN Requires-Python: >=3.7.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cwlformat-2020.3.26-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a886c7e9cac5f1cd5909b34468f96ff902a4c15407f7aa5106bd82dacf8d2b7f |
|
MD5 | 1e9aa3f1e618e7660348b349ed7856f7 |
|
BLAKE2b-256 | bfdc0ad9785b90ecc5d706287f696b14678e3a5bfec54fe4e296dbe5aea49544 |