Skip to content

Optionally allow to split class attribute values into multiple lines#212

Open
thet wants to merge 2 commits into
masterfrom
thet/class-multiline
Open

Optionally allow to split class attribute values into multiple lines#212
thet wants to merge 2 commits into
masterfrom
thet/class-multiline

Conversation

@thet
Copy link
Copy Markdown
Member

@thet thet commented May 8, 2026

  • 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-class option on the CLI.

thet added 2 commits May 8, 2026 23:54
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.
@thet thet requested a review from ale-rt May 8, 2026 23:16
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage is 97.204%thet/class-multiline into master. No base build found for master.

Copy link
Copy Markdown
Member

@ale-rt ale-rt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

3 participants