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
Several popular code formatters (ok I'm mostly thinking Black for Python) have the ability to customise wrapping of long lines of code based on the presence of a trailing comma. In Black this is called the magic comma
The magic trailing comma
Black in general does not take existing formatting into account.
However, there are cases where you put a short collection or function call in your code but you anticipate it will grow in the future.
Early versions of Black used to ruthlessly collapse those into one line (it fits!). Now, you can communicate that you don’t want that by putting a trailing comma in the collection yourself. When you do, Black will know to always explode your collection into one item per line.
How do you make it stop? Just delete that trailing comma and Black will collapse your collection into one line if it fits.
I think that this is a great pattern that we could also use in Nextflow. Both commas for things like maps and lists, but also semi-colons for things like consecutive imports.
Several popular code formatters (ok I'm mostly thinking Black for Python) have the ability to customise wrapping of long lines of code based on the presence of a trailing comma. In Black this is called the magic comma
I think that this is a great pattern that we could also use in Nextflow. Both commas for things like maps and lists, but also semi-colons for things like consecutive imports.
The text was updated successfully, but these errors were encountered: