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

Option to specify format options directly through CLI args #88

Closed
UtkarshVerma opened this issue Jan 25, 2023 · 5 comments · Fixed by #98
Closed

Option to specify format options directly through CLI args #88

UtkarshVerma opened this issue Jan 25, 2023 · 5 comments · Fixed by #98
Milestone

Comments

@UtkarshVerma
Copy link

I use yamlfmt in my NVIM setup. I want to avoid creating a config.yaml and instead configure the formatting behaviour through the CLI args instead. Most other formatters already support this.

For example, to set the max_line_length, I just wish to do the following:

yamlfmt --max-line-length=80 in.yaml
@UtkarshVerma
Copy link
Author

yamllint has the -d flag which would also seem apt for my use case.

@braydonk
Copy link
Collaborator

Thanks for making an issue!

This would be harder than it sounds. I could do it, but I would need to redesign how the tool actually discovers its config.

As a quicker thing, the tool does support using a .yamlfmt file in the system-wide config directory. It's not quite as convenient for a neovim config as cli flags would be, but it would be easier than having to make a .yamlfmt for every directory.

@braydonk
Copy link
Collaborator

I think I've come up with a sane way to do this now, it will be in the next release.

@braydonk
Copy link
Collaborator

This is merged! You can try it out by installing from main: go install github.com/google/yamlfmt/cmd/yamlfmt@main or wait til v0.9.0 release which I'm aiming to do next week.

@UtkarshVerma
Copy link
Author

Thanks a lot!

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

Successfully merging a pull request may close this issue.

2 participants