Skip to content

Larger "small" heuristics for smaller max_width #2606

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

Closed
kaj opened this issue Apr 7, 2018 · 1 comment
Closed

Larger "small" heuristics for smaller max_width #2606

kaj opened this issue Apr 7, 2018 · 1 comment

Comments

@kaj
Copy link

kaj commented Apr 7, 2018

I'm not sure where to put this. It is kind of related to #2299, #2447, and #2437. But I might be happier with a simpler solution than whats suggested there, so I open a specific issue.

I use max_width = 78 (since I want a git diff of my code to fit within an 80 chars wide terminal), and I want "short" struct literals and if-else statements to be single line, so I leave use_small_heuristics to its default true value.

Since most of the the default WidthHeuristics are defined in relation to max_width, which defaults to 100, I think many of the heuristics simply get too small when using a smaller max_width.

So my intent was to suggest non-linear values in WidthHeuristics::scale (maybe simply leaving it as is for max_width >= 90 and otherwise using e.g. values 85, 25, 50, and 75 instead of 60, 18, 35, and 50).

But maybe something like #2447 is a better alternative? Maybe it can be generalized to having different named set of heuristics? On the other hand, less configuration is better, so I rather like the concept that the heuristics should attempt to adapt as good as possible to the given max_width.

@topecongiro
Copy link
Contributor

We will restore the per-item width configuration in 2.0.

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

No branches or pull requests

2 participants