Skip to content

Feature idea: wrap command arguments to multiple lines #690

@mikez

Description

@mikez

Python

In Python code formatters, long lines like these:

create_join_index(self.right.index, self.left.index, right_indexer, left_indexer, how="left")

get changed to

create_join_index(
    self.right.index,
    self.left.index,
    right_indexer,
    left_indexer,
    how="left",
)

Bash

How about, in bash, if sufficiently long lines:

ffmpeg -ss 12:34 -i https://example.com/video.mp4 -vframes 1 -q:v 2 path/to/wonderful/screenshot.jpg

were changed to

ffmpeg \
    -ss 12:34 \
    -i https://example.com/video.mp4 \
    -vframes 1 \
    -q:v 2 \
    path/to/wonderful/screenshot.jpg

There would be some heuristics involved, but even a close approximation would save lots of reformatting. Are there any libraries or scripts around attempting to do this already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions