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

make array generation configurable (fixes #260) #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

d-rk
Copy link

@d-rk d-rk commented Mar 16, 2021

Hey,

this PR makes the array generation configurable (fixes #260). it introduces three new configuration parameters:

format: {
  arrays: {
    # after 'maxElementsPerLine' elements a newline will be inserted
    maxElementsPerLine: 1,
    
    # if the line would exceed `maxLineWidth`, a newline is inserted before the element
    maxLineWidth: 80
    
    # if an array does not fit into a single line, but the first element should directly follow
    # the opening bracket of the array without linebreak, set this to true
    multilineArrayStartsInline: false,
  }
}

The chosen defaults will only change the generation of arrays (compared to current master branch) if maxLineWidth is exceeded.

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 this pull request may close these issues.

smarter rendering of array elements across lines
1 participant