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

max_line_length does not hold #191

Open
PatrissTV opened this issue Jul 3, 2024 · 1 comment
Open

max_line_length does not hold #191

PatrissTV opened this issue Jul 3, 2024 · 1 comment
Labels
yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix.

Comments

@PatrissTV
Copy link

max_line_length does not ensure that a lines has less characters than this value. Instead, the line is broken after the first word that is located after max_line_length.

A quick fix would be to simply apply a line break on the blank space before the word, and not after.

I understand that this feature is still under development.

@braydonk braydonk added the yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix. label Jul 8, 2024
@braydonk
Copy link
Collaborator

braydonk commented Jul 8, 2024

Thanks for opening an issue! As mentioned in the docs, this utilizes the best_width feature from the underlying library, and I've so far been unsuccessful in improving what it does. The config name max_line_length was an unfortunate choice by me, as it implies a guarantee that yamlfmt unfortunately can't make.

I unfortunately can't make any specific promises as to when I will get to this but it will be in my backlog for library issues that I will try to get to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
yaml_v3_problem A bug in the underlying yaml library. These issues are vastly harder to fix.
Projects
None yet
Development

No branches or pull requests

2 participants