Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range formatting #276

Open
veselyn opened this issue Mar 25, 2024 · 3 comments
Open

Range formatting #276

veselyn opened this issue Mar 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@veselyn
Copy link

veselyn commented Mar 25, 2024

Is your feature request related to a problem? Please describe.

I would like to be able to format specific ranges of files.

For example, given the following file:

if true; then
fi

if false;       then
  fi

I would be able to format only the second if statement.

Describe the solution you'd like

Two parameters for the CLI:

  • --range-start to specify from which line of the file to start, preferably starting from 0
  • --range-end to specify until which line to format

Additional context

A popular code editor, Neovim, has support for range formatting but it requires the formatter to have options to specify the range.

@veselyn veselyn added the enhancement New feature or request label Mar 25, 2024
@brianmcgee
Copy link
Member

If I understand correctly, this would be only used in conjunction with --stdin mode?

@veselyn
Copy link
Author

veselyn commented Aug 19, 2024

If I understand correctly, this would be only used in conjunction with --stdin mode?

Correct! :)

@brianmcgee
Copy link
Member

Should be easy enough to add 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants