Optionally allow to split class attribute values into multiple lines#212
Open
thet wants to merge 2 commits into
Open
Optionally allow to split class attribute values into multiple lines#212thet wants to merge 2 commits into
thet wants to merge 2 commits into
Conversation
Split multiple class attribute values into multiple lines. Keep it single-lined, if there is only one value. And don't split Chameleon expressions.
Per default class attributes are not split into multiple lines. That's what most tools do and most people would expect. To split class attributes into multiple lines use the `--split-class` option on the CLI.
ale-rt
requested changes
May 11, 2026
Member
There was a problem hiding this comment.
This will for the first time introduce a flag that controls how zpretty formats the file.
I do not think we should add it.
Either we go for always having class names split one per line or we never do that.
For me it is fine to have classes one per line, but I think this should be discussed with the community, also because it will cause a lot of broken dependabot PRs.
If we go for such a bold move, it might also be interesting to change that only if the line length is longer than a given amount of characters (that would even make the formatter fully compliant with the ZCML style guide, see #12).
But before deciding something on this I would like to hear more opinions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiline values for class attributes.
Split multiple class attribute values into multiple lines. Keep it
single-lined, if there is only one value. And don't split Chameleon
expressions.
Add a switch for multiline class attribute values.
Per default class attributes are not split into multiple lines. That's what
most tools do and most people would expect. To split class attributes into
multiple lines use the
--split-classoption on the CLI.