net.twisterrob.gradle
net.twisterrob.gradle copied to clipboard
Code is unnecessarily indented
trafficstars

Move indentation to lower levels.
Index: quality/src/main/resources/violations.xsl
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/quality/src/main/resources/violations.xsl b/quality/src/main/resources/violations.xsl
--- a/quality/src/main/resources/violations.xsl
+++ b/quality/src/main/resources/violations.xsl
@@ -170,7 +170,7 @@
<xsl:if test="details/@rule != $prevRule or location/@module != $prevModule">
<a name="{details/@category}-{source/@reporter}-{details/@rule}-{location/@module}" />
</xsl:if>
- <div class="violation" xml:space="preserve">
+ <div class="violation">
<span class="title">
<!-- @formatter:off -->
<xsl:choose>
@@ -215,7 +215,7 @@
<!-- @formatter:on -->
</summary>
<xsl:if test="details/context/@type = 'code'">
- <pre class="hljs"><code><!--
+ <pre class="hljs" xml:space="preserve"><code><!--
--><script>
// @formatter:off
render.code(
@@ -232,33 +232,35 @@
--></code></pre>
</xsl:if>
<xsl:if test="details/context/@type = 'archive'">
- <pre><code><xsl:value-of select="details/context" /></code></pre>
+ <pre xml:space="preserve"><code><xsl:value-of select="details/context" /></code></pre>
</xsl:if>
<xsl:if test="details/context/@type = 'image'">
- <p><img src="{details/context/text()}" /></p>
+ <p>
+ <img src="{details/context/text()}" />
+ </p>
</xsl:if>
<xsl:if test="details/context/@type = 'error'">
<details class="description">
<summary>
- <pre><code><xsl:value-of select="details/context/@message" /></code></pre>
+ <pre xml:space="preserve"><code><xsl:value-of select="details/context/@message" /></code></pre>
</summary>
- <pre><code><xsl:value-of select="details/context" /></code></pre>
+ <pre xml:space="preserve"><code><xsl:value-of select="details/context" /></code></pre>
</details>
</xsl:if>
</details>
<xsl:if test="string-length(normalize-space(details/description)) != 0">
<details class="description">
<summary>
- <script>render.markdown(`<xsl:value-of select="details/message" />`)</script>
+ <script xml:space="preserve">render.markdown(`<xsl:value-of select="details/message" />`)</script>
</summary>
<section>
- <script>render.markdown(`<xsl:value-of select="details/description" />`)</script>
+ <script xml:space="preserve">render.markdown(`<xsl:value-of select="details/description" />`)</script>
</section>
</details>
</xsl:if>
<xsl:if test="string-length(normalize-space(details/description)) = 0">
<div class="description">
- <script>render.markdown(`<xsl:value-of select="details/message" />`)</script>
+ <script xml:space="preserve">render.markdown(`<xsl:value-of select="details/message" />`)</script>
</div>
</xsl:if>
</div>
The problem in OP is that <pre class="hljs"><code><!-- somehow gets re-indented even with xsl:space="preserve", this might be since Java 11.
Have a look into <xsl:strip-space elements="*" /> and <xsl:preserve-space elements="..."/>