-
Notifications
You must be signed in to change notification settings - Fork 5
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
Why this one line tag with multiple attributes was changed? #12
Comments
zpretty does always write one attribute per line which is in contrast with the zcml style. |
I think the length could follow zcml style itself:
|
Given to have easy diffing support, I would keep them on single lines. |
i was of similar opinions, unless i saw that it quickly becomes very difficult to read in an example like below. <div class="collapse navbar-collapse" id="navbar">
{% if session["user_id"] %}
<ul class="navbar-nav me-auto mt-2">
<li class="nav-item">
<a class="nav-link" href="/quote">Quote</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/buy">Buy</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/sell">Sell</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/history">History</a>
</li>
</ul>
<ul class="navbar-nav ms-auto mt-2">
<li class="nav-item">
<a class="nav-link" href="/logout">Log Out</a>
</li>
</ul>
{% else %}
<ul class="navbar-nav ms-auto mt-2">
<li class="nav-item">
<a class="nav-link" href="/register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/login">Log In</a>
</li>
</ul>
{% endif %}
</div> |
Black allows some control here, the magic trailing comma: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#the-magic-trailing-comma |
From https://zopetoolkit.readthedocs.io/en/latest/codingstyle/zcml-style.html#attributes:
But as shown in plone/plone.api#219 (comment):
was changed to:
Since "If all the attributes fit on one line with the tag name, do that" is already met, why the line was changed? I'm not sure if this is really a bug...
The text was updated successfully, but these errors were encountered: