Skip to content

Commit 8debade

Browse files
authored
Improving a bit the rendering process (#163)
1 parent 2a2aeb5 commit 8debade

14 files changed

Lines changed: 17 additions & 4 deletions

.cursor/rules/110-java-maven-best-practices.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ Description: Define all dependency and plugin versions in the `<properties>` sec
584584
</project>
585585

586586
```
587+
587588
## Output Format
588589

589590
- Update the file pom.xml if something is not correct

.cursor/rules/121-java-object-oriented-design.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,7 @@ public class FileManager {
24662466
}
24672467
}
24682468
```
2469+
24692470
## Output Format
24702471

24712472
- Apply object-oriented design principles to improve code quality and maintainability

.cursor/rules/122-java-type-design.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ class BadProductService {
851851
}
852852
}
853853
```
854+
854855
## Output Format
855856

856857
- Apply type design principles to improve code quality and maintainability

.cursor/rules/123-java-general-guidelines.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ public class UnsafeFileProcessor {
328328
}
329329
}
330330
```
331+
331332
## Output Format
332333

333334
- Apply the Java general guidelines to improve code quality and maintainability

generator/src/main/resources/110-java-maven-best-practices.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ my-app/
554554
</project>
555555
]]></code-block>
556556
</good-example>
557-
<bad-example>
557+
<bad-example last-item="true">
558558
<code-block language="xml"><![CDATA[
559559
<!-- Hardcoded versions scattered throughout the POM -->
560560
<project>

generator/src/main/resources/121-java-object-oriented-design.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,7 @@ class FileOperationException extends Exception {
25912591
}
25922592
}]]></code-block>
25932593
</good-example>
2594-
<bad-example>
2594+
<bad-example last-item="true">
25952595
<code-block language="java"><![CDATA[public class FileManager {
25962596
public String readFileContent(String filename) {
25972597
try {

generator/src/main/resources/122-java-type-design.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ class ProductService {
850850
}
851851
}]]></code-block>
852852
</good-example>
853-
<bad-example>
853+
<bad-example last-item="true">
854854
<code-block language="java"><![CDATA[import java.util.ArrayList;
855855
import java.util.HashMap;
856856

generator/src/main/resources/123-java-general-guidelines.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public class SecureFileProcessor {
323323
}
324324
}]]></code-block>
325325
</good-example>
326-
<bad-example>
326+
<bad-example last-item="true">
327327
<code-block language="java"><![CDATA[// AVOID: Poor error handling
328328
public class UnsafeFileProcessor {
329329

generator/src/main/resources/cursor-rules.xsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ Description: </xsl:text> <xsl:value-of select="normalize-space(example-de
100100
</xsl:call-template>
101101
<xsl:text>
102102
```</xsl:text>
103+
<xsl:if test="code-examples/bad-example/@last-item = 'true'">
104+
<xsl:text>
105+
</xsl:text>
106+
</xsl:if>
103107
</xsl:if>
104108
<xsl:if test="position() != last()">
105109
<xsl:text>

generator/src/main/resources/pml.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
<xs:sequence>
173173
<xs:element ref="code-block"/>
174174
</xs:sequence>
175+
<xs:attribute name="last-item" type="xs:boolean" use="optional" default="false"/>
175176
</xs:complexType>
176177
</xs:element>
177178

0 commit comments

Comments
 (0)